From 3f10519b0b7f196d68c4ac3fb57df6f4ce3fdc95 Mon Sep 17 00:00:00 2001 From: Shubham Tiwari Date: Fri, 4 Oct 2024 18:30:19 +0530 Subject: [PATCH] chore: add rest folder --- .gitignore | 1 + rest/api/v3/account_provisioning/README.md | 87 +++++++++ .../api_authenticate_account.go | 52 +++++ .../api_create_account.go | 74 +++++++ .../api_delete_account.go | 52 +++++ .../api_get_account_state.go | 61 ++++++ .../account_provisioning/api_list_account.go | 70 +++++++ .../api_list_account_offering.go | 61 ++++++ .../account_provisioning/api_list_offering.go | 49 +++++ .../v3/account_provisioning/api_service.go | 34 ++++ .../api_update_account_offering.go | 76 ++++++++ .../api_update_account_state.go | 68 +++++++ .../account_provisioning/docs/AccountList.md | 12 ++ .../docs/AccountProvisioningAccount.md | 12 ++ .../docs/AccountProvisioningAccountId.md | 11 ++ .../docs/AccountProvisioningCatalog.md | 11 ++ .../docs/AccountProvisioningOfferingList.md | 11 ++ .../docs/AccountProvisioningOfferingV1.md | 13 ++ .../docs/AccountProvisioningPagination.md | 12 ++ .../docs/AccountProvisioningProfile.md | 17 ++ .../docs/AccountProvisioningStateRead.md | 11 ++ .../docs/AccountProvisioningStateWrite.md | 11 ++ .../docs/AuthenticateAccount.md | 51 +++++ .../account_provisioning/docs/CatalogEntry.md | 12 ++ .../docs/CatalogEntryEntitlements.md | 14 ++ .../docs/CreateAccount.md | 48 +++++ .../docs/CreateAccountParams.md | 12 ++ .../docs/DeleteAccount.md | 51 +++++ .../docs/ErrorResponse.md | 13 ++ .../docs/GetAccountState.md | 51 +++++ .../account_provisioning/docs/ListAccount.md | 49 +++++ .../docs/ListAccountOffering.md | 51 +++++ .../account_provisioning/docs/ListOffering.md | 44 +++++ .../docs/OfferingsToAdd.md | 11 ++ .../api/v3/account_provisioning/docs/State.md | 16 ++ .../v3/account_provisioning/docs/State1.md | 13 ++ rest/api/v3/account_provisioning/docs/Type.md | 13 ++ .../docs/UpdateAccountOffering.md | 51 +++++ .../docs/UpdateAccountState.md | 51 +++++ .../model_account_list.go | 21 ++ .../model_account_provisioning_account.go | 26 +++ .../model_account_provisioning_account_id.go | 20 ++ .../model_account_provisioning_catalog.go | 19 ++ ...odel_account_provisioning_offering_list.go | 19 ++ .../model_account_provisioning_offering_v1.go | 24 +++ .../model_account_provisioning_pagination.go | 21 ++ .../model_account_provisioning_profile.go | 32 +++ .../model_account_provisioning_state_read.go | 20 ++ .../model_account_provisioning_state_write.go | 20 ++ .../model_catalog_entry.go | 20 ++ .../model_catalog_entry_entitlements.go | 26 +++ .../model_create_account_params.go | 21 ++ .../model_error_response.go | 24 +++ .../model_offerings_to_add.go | 20 ++ .../v3/account_provisioning/model_state.go | 26 +++ .../v3/account_provisioning/model_state1.go | 23 +++ .../api/v3/account_provisioning/model_type.go | 23 +++ rest/api/v3/alerts/README.md | 77 ++++++++ rest/api/v3/alerts/api_create_alert.go | 82 ++++++++ rest/api/v3/alerts/api_delete_alert.go | 62 ++++++ rest/api/v3/alerts/api_get_alert.go | 71 +++++++ rest/api/v3/alerts/api_list_alert.go | 59 ++++++ rest/api/v3/alerts/api_service.go | 34 ++++ rest/api/v3/alerts/api_update_alert.go | 86 ++++++++ rest/api/v3/alerts/docs/CreateAlert.md | 49 +++++ .../v3/alerts/docs/CreateAlert201Response.md | 17 ++ rest/api/v3/alerts/docs/CreateAlertRequest.md | 14 ++ rest/api/v3/alerts/docs/DeleteAlert.md | 52 +++++ rest/api/v3/alerts/docs/ErrorResponse.md | 12 ++ .../alerts/docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/alerts/docs/GetAlert.md | 52 +++++ .../api/v3/alerts/docs/GetAlert200Response.md | 17 ++ rest/api/v3/alerts/docs/ListAlert.md | 48 +++++ .../alerts/docs/ListAlert200ResponseInner.md | 17 ++ rest/api/v3/alerts/docs/Type.md | 13 ++ rest/api/v3/alerts/docs/Type1.md | 13 ++ rest/api/v3/alerts/docs/Type2.md | 13 ++ rest/api/v3/alerts/docs/Type3.md | 13 ++ rest/api/v3/alerts/docs/UpdateAlert.md | 53 +++++ .../v3/alerts/docs/UpdateAlert200Response.md | 17 ++ rest/api/v3/alerts/docs/UpdateAlertRequest.md | 13 ++ .../alerts/model_create_alert_201_response.go | 32 +++ .../v3/alerts/model_create_alert_request.go | 26 +++ rest/api/v3/alerts/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../v3/alerts/model_get_alert_200_response.go | 32 +++ .../model_list_alert_200_response_inner.go | 32 +++ rest/api/v3/alerts/model_type.go | 23 +++ rest/api/v3/alerts/model_type1.go | 23 +++ rest/api/v3/alerts/model_type2.go | 23 +++ rest/api/v3/alerts/model_type3.go | 23 +++ .../alerts/model_update_alert_200_response.go | 32 +++ .../v3/alerts/model_update_alert_request.go | 24 +++ rest/api/v3/api_keys/README.md | 76 ++++++++ rest/api/v3/api_keys/api_create_api_key.go | 106 ++++++++++ rest/api/v3/api_keys/api_delete_api_key.go | 94 +++++++++ rest/api/v3/api_keys/api_get_api_key.go | 102 ++++++++++ rest/api/v3/api_keys/api_list_api_key.go | 94 +++++++++ rest/api/v3/api_keys/api_service.go | 34 ++++ rest/api/v3/api_keys/api_update_api_key.go | 117 +++++++++++ .../v3/api_keys/api_update_api_key_name.go | 117 +++++++++++ rest/api/v3/api_keys/docs/ApiKeyResponse.md | 12 ++ .../v3/api_keys/docs/ApiKeyScopesResponse.md | 13 ++ rest/api/v3/api_keys/docs/CreateApiKey.md | 49 +++++ .../api_keys/docs/CreateApiKey201Response.md | 14 ++ .../v3/api_keys/docs/CreateApiKeyRequest.md | 12 ++ rest/api/v3/api_keys/docs/DeleteApiKey.md | 52 +++++ rest/api/v3/api_keys/docs/ErrorResponse.md | 12 ++ .../api_keys/docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/api_keys/docs/GetApiKey.md | 52 +++++ .../v3/api_keys/docs/GetApiKey200Response.md | 11 ++ rest/api/v3/api_keys/docs/ListApiKey.md | 49 +++++ .../v3/api_keys/docs/ListApiKey200Response.md | 11 ++ rest/api/v3/api_keys/docs/UpdateApiKey.md | 53 +++++ rest/api/v3/api_keys/docs/UpdateApiKeyName.md | 53 +++++ .../api_keys/docs/UpdateApiKeyNameRequest.md | 11 ++ .../v3/api_keys/docs/UpdateApiKeyRequest.md | 12 ++ .../api/v3/api_keys/model_api_key_response.go | 22 +++ .../api_keys/model_api_key_scopes_response.go | 24 +++ .../model_create_api_key_201_response.go | 22 +++ .../api_keys/model_create_api_key_request.go | 22 +++ rest/api/v3/api_keys/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../model_get_api_key_200_response.go | 19 ++ .../model_list_api_key_200_response.go | 19 ++ .../model_update_api_key_name_request.go | 20 ++ .../api_keys/model_update_api_key_request.go | 20 ++ rest/api/v3/domain_authentication/README.md | 103 ++++++++++ .../api_add_ip_to_authenticated_domain.go | 86 ++++++++ .../api_associate_subuser_with_domain.go | 77 ++++++++ ..._associate_subuser_with_domain_multiple.go | 77 ++++++++ .../api_authenticate_domain.go | 74 +++++++ .../api_delete_authenticated_domain.go | 70 +++++++ ...api_delete_ip_from_authenticated_domain.go | 80 ++++++++ ...ssociate_authenticated_domain_from_user.go | 60 ++++++ .../api_disassociate_subuser_from_domain.go | 72 +++++++ .../api_email_dns_record.go | 65 +++++++ .../api_get_authenticated_domain.go | 70 +++++++ ...list_all_authenticated_domain_with_user.go | 60 ++++++ .../api_list_authenticated_domain.go | 106 ++++++++++ ...api_list_authenticated_domain_with_user.go | 60 ++++++ .../api_list_default_authenticated_domain.go | 69 +++++++ .../v3/domain_authentication/api_service.go | 34 ++++ .../api_update_authenticated_domain.go | 85 ++++++++ .../api_validate_authenticated_domain.go | 79 ++++++++ .../docs/AddIpToAuthenticatedDomain.md | 53 +++++ .../docs/AddIpToAuthenticatedDomainRequest.md | 11 ++ .../docs/AssociateSubuserWithDomain.md | 52 +++++ .../AssociateSubuserWithDomainMultiple.md | 52 +++++ .../docs/AssociateSubuserWithDomainRequest.md | 11 ++ .../docs/AuthenticateDomain.md | 49 +++++ .../docs/AuthenticateDomainRequest.md | 19 ++ .../docs/AuthenticatedDomain.md | 22 +++ .../docs/AuthenticatedDomainSpf.md | 22 +++ .../docs/AuthenticatedDomainSpfDns.md | 14 ++ .../docs/AuthenticatedDomainSpfDnsDkim.md | 14 ++ .../AuthenticatedDomainSpfDnsDomainSpf.md | 14 ++ .../AuthenticatedDomainSpfDnsMailServer.md | 14 ++ .../AuthenticatedDomainSpfDnsSubdomainSpf.md | 14 ++ .../docs/DeleteAuthenticatedDomain.md | 52 +++++ .../docs/DeleteIpFromAuthenticatedDomain.md | 53 +++++ ...DisassociateAuthenticatedDomainFromUser.md | 48 +++++ .../docs/DisassociateSubuserFromDomain.md | 52 +++++ .../docs/EmailDnsRecord.md | 48 +++++ .../docs/EmailDnsRecord400Response.md | 11 ++ .../docs/EmailDnsRecord400ResponseErrors.md | 12 ++ .../docs/EmailDnsRecordRequest.md | 14 ++ .../docs/GetAuthenticatedDomain.md | 52 +++++ .../ListAllAuthenticatedDomainWithUser.md | 47 +++++ ...enticatedDomainWithUser200ResponseInner.md | 22 +++ ...icatedDomainWithUser200ResponseInnerDns.md | 13 ++ ...dDomainWithUser200ResponseInnerDnsDkim1.md | 14 ++ ...ainWithUser200ResponseInnerDnsMailCname.md | 14 ++ .../docs/ListAuthenticatedDomain.md | 53 +++++ .../docs/ListAuthenticatedDomainWithUser.md | 47 +++++ .../docs/ListDefaultAuthenticatedDomain.md | 49 +++++ .../docs/UpdateAuthenticatedDomain.md | 53 +++++ .../docs/UpdateAuthenticatedDomainRequest.md | 12 ++ .../docs/ValidateAuthenticatedDomain.md | 52 +++++ .../ValidateAuthenticatedDomain200Response.md | 13 ++ ...catedDomain200ResponseValidationResults.md | 14 ++ ...Domain200ResponseValidationResultsDkim1.md | 12 ++ ...in200ResponseValidationResultsMailCname.md | 12 ++ ...edDomain200ResponseValidationResultsSpf.md | 12 ++ .../ValidateAuthenticatedDomain500Response.md | 11 ++ ...thenticatedDomain500ResponseErrorsInner.md | 11 ++ ..._add_ip_to_authenticated_domain_request.go | 20 ++ ...l_associate_subuser_with_domain_request.go | 20 ++ .../model_authenticate_domain_request.go | 36 ++++ .../model_authenticated_domain.go | 41 ++++ .../model_authenticated_domain_spf.go | 41 ++++ .../model_authenticated_domain_spf_dns.go | 22 +++ ...model_authenticated_domain_spf_dns_dkim.go | 26 +++ ...authenticated_domain_spf_dns_domain_spf.go | 26 +++ ...uthenticated_domain_spf_dns_mail_server.go | 26 +++ ...henticated_domain_spf_dns_subdomain_spf.go | 26 +++ .../model_email_dns_record_400_response.go | 19 ++ ...el_email_dns_record_400_response_errors.go | 20 ++ .../model_email_dns_record_request.go | 26 +++ ...ted_domain_with_user_200_response_inner.go | 41 ++++ ...domain_with_user_200_response_inner_dns.go | 21 ++ ..._with_user_200_response_inner_dns_dkim1.go | 26 +++ ..._user_200_response_inner_dns_mail_cname.go | 26 +++ ...del_update_authenticated_domain_request.go | 22 +++ ...idate_authenticated_domain_200_response.go | 23 +++ ..._domain_200_response_validation_results.go | 22 +++ ...n_200_response_validation_results_dkim1.go | 21 ++ ..._response_validation_results_mail_cname.go | 22 +++ ...ain_200_response_validation_results_spf.go | 21 ++ ...idate_authenticated_domain_500_response.go | 19 ++ ...icated_domain_500_response_errors_inner.go | 20 ++ rest/api/v3/email_activity/README.md | 89 +++++++++ .../api/v3/email_activity/api_download_csv.go | 77 ++++++++ rest/api/v3/email_activity/api_get_message.go | 85 ++++++++ .../api/v3/email_activity/api_list_message.go | 86 ++++++++ rest/api/v3/email_activity/api_request_csv.go | 84 ++++++++ rest/api/v3/email_activity/api_service.go | 34 ++++ .../api/v3/email_activity/docs/AbbvMessage.md | 18 ++ rest/api/v3/email_activity/docs/BounceType.md | 13 ++ .../api/v3/email_activity/docs/BounceType1.md | 13 ++ .../api/v3/email_activity/docs/DownloadCsv.md | 51 +++++ .../docs/DownloadCsv200Response.md | 12 ++ .../docs/EmailActivityResponseBaseProps.md | 15 ++ rest/api/v3/email_activity/docs/Event.md | 18 ++ rest/api/v3/email_activity/docs/EventName.md | 22 +++ rest/api/v3/email_activity/docs/EventName1.md | 22 +++ rest/api/v3/email_activity/docs/GetMessage.md | 51 +++++ .../docs/GetMessage404Response.md | 11 ++ .../docs/GetMessage404ResponseErrorsInner.md | 12 ++ .../api/v3/email_activity/docs/ListMessage.md | 48 +++++ .../docs/ListMessage200Response.md | 11 ++ .../docs/ListMessage400Response.md | 11 ++ .../docs/ListMessage400ResponseErrorsInner.md | 11 ++ .../docs/ListMessage429Response.md | 11 ++ .../docs/ListMessage429ResponseErrorsInner.md | 11 ++ rest/api/v3/email_activity/docs/Message.md | 25 +++ .../v3/email_activity/docs/OutboundIpType.md | 13 ++ .../v3/email_activity/docs/OutboundIpType1.md | 13 ++ rest/api/v3/email_activity/docs/RequestCsv.md | 48 +++++ .../docs/RequestCsv202Response.md | 12 ++ rest/api/v3/email_activity/docs/Status.md | 14 ++ rest/api/v3/email_activity/docs/Status1.md | 14 ++ rest/api/v3/email_activity/docs/Status2.md | 12 ++ rest/api/v3/email_activity/docs/Status3.md | 14 ++ .../v3/email_activity/model_abbv__message.go | 27 +++ .../v3/email_activity/model_bounce_type.go | 23 +++ .../v3/email_activity/model_bounce_type1.go | 23 +++ .../model_download_csv_200_response.go | 22 +++ ...odel_email_activity_response_base_props.go | 28 +++ rest/api/v3/email_activity/model_event.go | 34 ++++ .../api/v3/email_activity/model_event_name.go | 32 +++ .../v3/email_activity/model_event_name1.go | 32 +++ .../model_get_message_404_response.go | 19 ++ ...l_get_message_404_response_errors_inner.go | 20 ++ .../model_list_message_200_response.go | 19 ++ .../model_list_message_400_response.go | 19 ++ ..._list_message_400_response_errors_inner.go | 19 ++ .../model_list_message_429_response.go | 19 ++ ..._list_message_429_response_errors_inner.go | 19 ++ rest/api/v3/email_activity/model_message.go | 48 +++++ .../email_activity/model_outbound_ip_type.go | 23 +++ .../email_activity/model_outbound_ip_type1.go | 23 +++ .../model_request_csv_202_response.go | 20 ++ rest/api/v3/email_activity/model_status.go | 24 +++ rest/api/v3/email_activity/model_status1.go | 24 +++ rest/api/v3/email_activity/model_status2.go | 22 +++ rest/api/v3/email_activity/model_status3.go | 24 +++ rest/api/v3/email_validation/README.md | 94 +++++++++ .../api_get_email_job_for_verification.go | 77 ++++++++ .../api_get_validations_email_jobs.go | 65 +++++++ .../api_list_email_job_for_verification.go | 81 ++++++++ rest/api/v3/email_validation/api_service.go | 34 ++++ .../v3/email_validation/api_validate_email.go | 65 +++++++ .../v3/email_validation/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/email_validation/docs/FileType.md | 13 ++ .../docs/GetEmailJobForVerification.md | 51 +++++ .../docs/GetValidationsEmailJobs.md | 44 +++++ .../GetValidationsEmailJobs200Response.md | 11 ++ ...idationsEmailJobs200ResponseResultInner.md | 14 ++ ...GetValidationsEmailJobsJobId200Response.md | 11 ++ ...idationsEmailJobsJobId200ResponseResult.md | 18 ++ ...ilJobsJobId200ResponseResultErrorsInner.md | 11 ++ .../docs/ListEmailJobForVerification.md | 48 +++++ .../ListEmailJobForVerificationRequest.md | 11 ++ .../PutValidationsEmailJobs200Response.md | 13 ++ ...sEmailJobs200ResponseUploadHeadersInner.md | 12 ++ rest/api/v3/email_validation/docs/Status.md | 17 ++ rest/api/v3/email_validation/docs/Status1.md | 17 ++ .../v3/email_validation/docs/ValidateEmail.md | 48 +++++ .../docs/ValidateEmail200Response.md | 11 ++ .../docs/ValidateEmail200ResponseResult.md | 19 ++ .../ValidateEmail200ResponseResultChecks.md | 13 ++ ...eEmail200ResponseResultChecksAdditional.md | 12 ++ ...idateEmail200ResponseResultChecksDomain.md | 13 ++ ...teEmail200ResponseResultChecksLocalPart.md | 11 ++ .../docs/ValidateEmailRequest.md | 12 ++ rest/api/v3/email_validation/docs/Verdict.md | 14 ++ .../email_validation/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../v3/email_validation/model_file_type.go | 23 +++ ..._get_validations_email_jobs200_response.go | 20 ++ ...ons_email_jobs200_response_result_inner.go | 26 +++ ...lidations_email_jobs_job_id200_response.go | 19 ++ ...ns_email_jobs_job_id200_response_result.go | 34 ++++ ..._job_id200_response_result_errors_inner.go | 20 ++ ...list_email_job_for_verification_request.go | 20 ++ ..._put_validations_email_jobs200_response.go | 24 +++ ...l_jobs200_response_upload_headers_inner.go | 22 +++ rest/api/v3/email_validation/model_status.go | 27 +++ rest/api/v3/email_validation/model_status1.go | 27 +++ .../model_validate_email_200_response.go | 19 ++ ...odel_validate_email_200_response_result.go | 35 ++++ ...lidate_email_200_response_result_checks.go | 21 ++ ...l_200_response_result_checks_additional.go | 22 +++ ...email_200_response_result_checks_domain.go | 24 +++ ...l_200_response_result_checks_local_part.go | 20 ++ .../model_validate_email_request.go | 22 +++ rest/api/v3/email_validation/model_verdict.go | 24 +++ rest/api/v3/enforced_tls/README.md | 68 +++++++ .../api_list_enforced_tls_setting.go | 83 ++++++++ rest/api/v3/enforced_tls/api_service.go | 34 ++++ .../api_update_enforced_tls_setting.go | 98 ++++++++++ .../docs/EnforcedTlsRequestResponse.md | 13 ++ .../api/v3/enforced_tls/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ .../docs/ListEnforcedTlsSetting.md | 48 +++++ .../docs/UpdateEnforcedTlsSetting.md | 49 +++++ rest/api/v3/enforced_tls/docs/Version.md | 14 ++ .../model_enforced_tls_request_response.go | 24 +++ .../v3/enforced_tls/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ rest/api/v3/enforced_tls/model_version.go | 24 +++ rest/api/v3/integrations/README.md | 94 +++++++++ .../v3/integrations/api_add_integration.go | 89 +++++++++ .../v3/integrations/api_delete_integration.go | 93 +++++++++ .../api_find_integration_by_id.go | 85 ++++++++ .../api_get_integrations_by_user.go | 65 +++++++ rest/api/v3/integrations/api_service.go | 34 ++++ .../v3/integrations/api_update_integration.go | 108 ++++++++++ .../v3/integrations/docs/AddIntegration.md | 47 +++++ .../docs/AddIntegration400Response.md | 11 ++ .../v3/integrations/docs/DeleteIntegration.md | 47 +++++ .../docs/DeleteIntegration400Response.md | 11 ++ .../docs/DeleteIntegration404Response.md | 11 ++ rest/api/v3/integrations/docs/Destination.md | 12 ++ rest/api/v3/integrations/docs/Destination1.md | 12 ++ rest/api/v3/integrations/docs/Destination2.md | 12 ++ rest/api/v3/integrations/docs/Destination3.md | 12 ++ .../v3/integrations/docs/DestinationRegion.md | 13 ++ .../integrations/docs/DestinationRegion1.md | 13 ++ .../integrations/docs/DestinationRegion2.md | 13 ++ .../integrations/docs/FindIntegrationById.md | 51 +++++ rest/api/v3/integrations/docs/Forbidden.md | 11 ++ .../docs/GetIntegrationsByUser.md | 44 +++++ .../docs/GetIntegrationsByUser200Response.md | 11 ++ .../docs/GetIntegrationsByUser403Response.md | 11 ++ .../docs/GetIntegrationsByUser500Response.md | 11 ++ rest/api/v3/integrations/docs/Id.md | 11 ++ rest/api/v3/integrations/docs/Integration.md | 16 ++ .../integrations/docs/IntegrationFilters.md | 11 ++ .../v3/integrations/docs/IntegrationInput.md | 14 ++ .../docs/IntegrationInputFilters.md | 11 ++ .../docs/IntegrationInputProperties.md | 12 ++ .../integrations/docs/IntegrationNotFound.md | 11 ++ .../v3/integrations/docs/IntegrationPatch.md | 14 ++ .../docs/IntegrationPatchFilters.md | 11 ++ .../docs/IntegrationPatchProperties.md | 12 ++ .../docs/IntegrationProperties.md | 12 ++ .../api/v3/integrations/docs/InternalError.md | 11 ++ .../integrations/docs/InvalidDeleteRequest.md | 12 ++ .../v3/integrations/docs/InvalidRequest.md | 12 ++ rest/api/v3/integrations/docs/Items.md | 23 +++ rest/api/v3/integrations/docs/Items1.md | 23 +++ rest/api/v3/integrations/docs/Items2.md | 23 +++ .../v3/integrations/docs/UpdateIntegration.md | 51 +++++ .../model_add_integration_400_response.go | 19 ++ .../model_delete_integration_400_response.go | 19 ++ .../model_delete_integration_404_response.go | 19 ++ rest/api/v3/integrations/model_destination.go | 22 +++ .../api/v3/integrations/model_destination1.go | 22 +++ .../api/v3/integrations/model_destination2.go | 22 +++ .../api/v3/integrations/model_destination3.go | 22 +++ .../integrations/model_destination_region.go | 23 +++ .../integrations/model_destination_region1.go | 23 +++ .../integrations/model_destination_region2.go | 23 +++ rest/api/v3/integrations/model_forbidden.go | 20 ++ ...l_get_integrations_by_user_200_response.go | 19 ++ ...l_get_integrations_by_user_403_response.go | 19 ++ ...l_get_integrations_by_user_500_response.go | 19 ++ rest/api/v3/integrations/model_id.go | 19 ++ rest/api/v3/integrations/model_integration.go | 28 +++ .../integrations/model_integration_filters.go | 20 ++ .../integrations/model_integration_input.go | 24 +++ .../model_integration_input_filters.go | 20 ++ .../model_integration_input_properties.go | 22 +++ .../model_integration_not_found.go | 20 ++ .../integrations/model_integration_patch.go | 24 +++ .../model_integration_patch_filters.go | 20 ++ .../model_integration_patch_properties.go | 22 +++ .../model_integration_properties.go | 22 +++ .../v3/integrations/model_internal_error.go | 20 ++ .../model_invalid_delete_request.go | 22 +++ .../v3/integrations/model_invalid_request.go | 22 +++ rest/api/v3/integrations/model_items.go | 33 ++++ rest/api/v3/integrations/model_items1.go | 33 ++++ rest/api/v3/integrations/model_items2.go | 33 ++++ rest/api/v3/ip_access_management/README.md | 79 ++++++++ .../api_add_ip_to_allow_list.go | 98 ++++++++++ .../api_delete_allowed_ip.go | 70 +++++++ .../api_delete_allowed_ips.go | 98 ++++++++++ .../api_get_allowed_ip.go | 70 +++++++ .../api_list_access_activity.go | 94 +++++++++ .../api_list_allowed_ip.go | 83 ++++++++ .../v3/ip_access_management/api_service.go | 34 ++++ .../docs/AddIpToAllowList.md | 49 +++++ .../docs/AddIpToAllowListRequest.md | 11 ++ .../docs/AddIpToAllowListRequestIpsInner.md | 11 ++ .../docs/DeleteAllowedIp.md | 52 +++++ .../docs/DeleteAllowedIps.md | 49 +++++ .../docs/DeleteAllowedIpsRequest.md | 11 ++ .../docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ .../ip_access_management/docs/GetAllowedIp.md | 52 +++++ .../docs/IpAccessManagement2xx.md | 11 ++ .../docs/IpAccessManagement2xxResultInner.md | 14 ++ .../docs/ListAccessActivity.md | 49 +++++ .../docs/ListAccessActivity200Response.md | 11 ++ ...istAccessActivity200ResponseResultInner.md | 16 ++ .../docs/ListAllowedIp.md | 48 +++++ .../model_add_ip_to_allow_list_request.go | 20 ++ ..._add_ip_to_allow_list_request_ips_inner.go | 20 ++ .../model_delete_allowed_ips_request.go | 20 ++ .../model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../model_ip_access_management2xx.go | 20 ++ ...el_ip_access_management2xx_result_inner.go | 26 +++ ...model_list_access_activity_200_response.go | 20 ++ ...cess_activity_200_response_result_inner.go | 30 +++ rest/api/v3/ip_address_management/README.md | 118 +++++++++++ .../v3/ip_address_management/api_add_ip.go | 89 +++++++++ .../api_add_ips_to_ip_pool.go | 100 ++++++++++ .../api_add_sub_users_to_ip.go | 100 ++++++++++ .../api_create_ip_pool.go | 89 +++++++++ .../api_delete_ip_pool.go | 77 ++++++++ .../api_delete_ips_from_ip_pool.go | 92 +++++++++ .../api_delete_sub_users_from_ip.go | 92 +++++++++ .../v3/ip_address_management/api_get_ip.go | 85 ++++++++ .../ip_address_management/api_get_ip_pool.go | 85 ++++++++ .../v3/ip_address_management/api_list_ip.go | 184 ++++++++++++++++++ .../api_list_ip_assigned_to_ip_pool.go | 103 ++++++++++ .../ip_address_management/api_list_ip_pool.go | 121 ++++++++++++ .../api_list_sub_user_assigned_to_ip.go | 94 +++++++++ .../v3/ip_address_management/api_service.go | 34 ++++ .../v3/ip_address_management/api_update_ip.go | 100 ++++++++++ .../api_update_ip_pool.go | 100 ++++++++++ .../v3/ip_address_management/docs/AddIp.md | 48 +++++ .../docs/AddIp201Response.md | 15 ++ .../docs/AddIpRequest.md | 15 ++ .../docs/AddIpsToIpPool.md | 52 +++++ .../docs/AddIpsToIpPool200Response.md | 13 ++ .../docs/AddIpsToIpPoolRequest.md | 11 ++ .../docs/AddSubUsersToIp.md | 52 +++++ .../docs/AddSubUsersToIp200Response.md | 12 ++ .../docs/AddSubUsersToIpRequest.md | 11 ++ .../docs/CreateIpPool.md | 48 +++++ .../docs/CreateIpPool201Response.md | 13 ++ .../docs/CreateIpPoolRequest.md | 12 ++ .../docs/DeleteIpPool.md | 51 +++++ .../docs/DeleteIpsFromIpPool.md | 52 +++++ .../docs/DeleteIpsFromIpPoolRequest.md | 11 ++ .../docs/DeleteSubUsersFromIp.md | 52 +++++ .../docs/DeleteSubUsersFromIpRequest.md | 11 ++ .../v3/ip_address_management/docs/GetIp.md | 48 +++++ .../docs/GetIp200Response.md | 19 ++ .../docs/GetIp200ResponsePoolsInner.md | 12 ++ .../ip_address_management/docs/GetIpPool.md | 48 +++++ .../docs/GetIpPool200Response.md | 15 ++ ...etIpPool200ResponseIpCountByRegionInner.md | 12 ++ .../docs/IpAddressManagementErrorResponse.md | 11 ++ ...dressManagementErrorResponseErrorsInner.md | 12 ++ .../v3/ip_address_management/docs/Items.md | 13 ++ .../v3/ip_address_management/docs/ListIp.md | 59 ++++++ .../docs/ListIp200Response.md | 12 ++ .../docs/ListIp200ResponseMetadata.md | 11 ++ .../ListIp200ResponseMetadataNextParams.md | 22 +++ .../docs/ListIp200ResponseResultInner.md | 19 ++ .../ListIp200ResponseResultInnerPoolsInner.md | 12 ++ .../docs/ListIpAssignedToIpPool.md | 50 +++++ .../docs/ListIpAssignedToIpPool200Response.md | 12 ++ ...stIpAssignedToIpPool200ResponseMetadata.md | 11 ++ ...edToIpPool200ResponseMetadataNextParams.md | 13 ++ ...pAssignedToIpPool200ResponseResultInner.md | 13 ++ .../ip_address_management/docs/ListIpPool.md | 52 +++++ .../docs/ListIpPool200Response.md | 12 ++ .../docs/ListIpPool200ResponseMetadata.md | 11 ++ ...ListIpPool200ResponseMetadataNextParams.md | 15 ++ .../docs/ListIpPool200ResponseResultInner.md | 15 ++ .../docs/ListSubUserAssignedToIp.md | 49 +++++ .../ListSubUserAssignedToIp200Response.md | 12 ++ ...tSubUserAssignedToIp200ResponseMetadata.md | 11 ++ ...signedToIp200ResponseMetadataNextParams.md | 12 ++ .../v3/ip_address_management/docs/Region.md | 13 ++ .../v3/ip_address_management/docs/Region1.md | 14 ++ .../v3/ip_address_management/docs/Region2.md | 13 ++ .../v3/ip_address_management/docs/Region3.md | 13 ++ .../v3/ip_address_management/docs/Region4.md | 14 ++ .../v3/ip_address_management/docs/Region5.md | 13 ++ .../v3/ip_address_management/docs/Region6.md | 13 ++ .../v3/ip_address_management/docs/Region7.md | 14 ++ .../v3/ip_address_management/docs/UpdateIp.md | 52 +++++ .../docs/UpdateIp200Response.md | 14 ++ .../docs/UpdateIpPool.md | 52 +++++ .../docs/UpdateIpPool200Response.md | 12 ++ .../docs/UpdateIpPoolRequest.md | 11 ++ .../docs/UpdateIpRequest.md | 13 ++ .../model_add_ip_201_response.go | 28 +++ .../model_add_ip_request.go | 28 +++ .../model_add_ips_to_ip_pool_200_response.go | 24 +++ .../model_add_ips_to_ip_pool_request.go | 20 ++ .../model_add_sub_users_to_ip_200_response.go | 22 +++ .../model_add_sub_users_to_ip_request.go | 20 ++ .../model_create_ip_pool_201_response.go | 24 +++ .../model_create_ip_pool_request.go | 22 +++ .../model_delete_ips_from_ip_pool_request.go | 20 ++ .../model_delete_sub_users_from_ip_request.go | 20 ++ .../model_get_ip_200_response.go | 36 ++++ .../model_get_ip_200_response_pools_inner.go | 22 +++ .../model_get_ip_pool_200_response.go | 28 +++ ...l_200_response_ip_count_by_region_inner.go | 22 +++ ...el_ip_address_management_error_response.go | 20 ++ ..._management_error_response_errors_inner.go | 22 +++ .../v3/ip_address_management/model_items.go | 23 +++ .../model_list_ip_200_response.go | 20 ++ .../model_list_ip_200_response__metadata.go | 19 ++ ...t_ip_200_response__metadata_next_params.go | 42 ++++ ...model_list_ip_200_response_result_inner.go | 36 ++++ ...p_200_response_result_inner_pools_inner.go | 22 +++ ...ist_ip_assigned_to_ip_pool_200_response.go | 20 ++ ...igned_to_ip_pool_200_response__metadata.go | 19 ++ ...pool_200_response__metadata_next_params.go | 24 +++ ...ed_to_ip_pool_200_response_result_inner.go | 24 +++ .../model_list_ip_pool_200_response.go | 20 ++ ...del_list_ip_pool_200_response__metadata.go | 19 ++ ...pool_200_response__metadata_next_params.go | 28 +++ ..._list_ip_pool_200_response_result_inner.go | 28 +++ ...st_sub_user_assigned_to_ip_200_response.go | 21 ++ ...r_assigned_to_ip_200_response__metadata.go | 19 ++ ...o_ip_200_response__metadata_next_params.go | 22 +++ .../v3/ip_address_management/model_region.go | 23 +++ .../v3/ip_address_management/model_region1.go | 24 +++ .../v3/ip_address_management/model_region2.go | 23 +++ .../v3/ip_address_management/model_region3.go | 23 +++ .../v3/ip_address_management/model_region4.go | 24 +++ .../v3/ip_address_management/model_region5.go | 23 +++ .../v3/ip_address_management/model_region6.go | 23 +++ .../v3/ip_address_management/model_region7.go | 24 +++ .../model_update_ip_200_response.go | 26 +++ .../model_update_ip_pool_200_response.go | 22 +++ .../model_update_ip_pool_request.go | 20 ++ .../model_update_ip_request.go | 24 +++ rest/api/v3/ip_warmup/README.md | 76 ++++++++ rest/api/v3/ip_warmup/api_get_warm_up_ip.go | 69 +++++++ rest/api/v3/ip_warmup/api_list_warm_up_ip.go | 49 +++++ rest/api/v3/ip_warmup/api_service.go | 34 ++++ rest/api/v3/ip_warmup/api_stop_ip_warm_up.go | 69 +++++++ rest/api/v3/ip_warmup/api_warm_up_ip.go | 73 +++++++ rest/api/v3/ip_warmup/docs/GetWarmUpIp.md | 51 +++++ .../ip_warmup/docs/GetWarmUpIp404Response.md | 11 ++ .../docs/GetWarmUpIp404ResponseErrorsInner.md | 12 ++ .../api/v3/ip_warmup/docs/IpWarmup200Inner.md | 12 ++ rest/api/v3/ip_warmup/docs/ListWarmUpIp.md | 44 +++++ rest/api/v3/ip_warmup/docs/StopIpWarmUp.md | 51 +++++ .../ip_warmup/docs/StopIpWarmUp404Response.md | 11 ++ .../StopIpWarmUp404ResponseErrorsInner.md | 12 ++ rest/api/v3/ip_warmup/docs/WarmUpIp.md | 48 +++++ .../v3/ip_warmup/docs/WarmUpIp404Response.md | 11 ++ .../docs/WarmUpIp404ResponseErrorsInner.md | 12 ++ rest/api/v3/ip_warmup/docs/WarmUpIpRequest.md | 11 ++ .../model_get_warm_up_ip_404_response.go | 20 ++ ...et_warm_up_ip_404_response_errors_inner.go | 21 ++ .../v3/ip_warmup/model_ip_warmup200_inner.go | 22 +++ .../model_stop_ip_warm_up_404_response.go | 20 ++ ...op_ip_warm_up_404_response_errors_inner.go | 21 ++ .../model_warm_up_ip_404_response.go | 20 ++ ...el_warm_up_ip_404_response_errors_inner.go | 21 ++ .../v3/ip_warmup/model_warm_up_ip_request.go | 20 ++ rest/api/v3/ips/README.md | 95 +++++++++ rest/api/v3/ips/api_add_ip.go | 73 +++++++ rest/api/v3/ips/api_add_ip_to_ip_pool.go | 84 ++++++++ rest/api/v3/ips/api_create_ip_pool.go | 65 +++++++ rest/api/v3/ips/api_delete_ip_from_ip_pool.go | 78 ++++++++ rest/api/v3/ips/api_delete_ip_pool.go | 69 +++++++ rest/api/v3/ips/api_get_ip.go | 61 ++++++ rest/api/v3/ips/api_get_ip_pool.go | 69 +++++++ rest/api/v3/ips/api_list_assigned_ip.go | 49 +++++ rest/api/v3/ips/api_list_ip.go | 106 ++++++++++ rest/api/v3/ips/api_list_ip_pool.go | 49 +++++ .../api/v3/ips/api_list_remaining_ip_count.go | 49 +++++ rest/api/v3/ips/api_service.go | 34 ++++ rest/api/v3/ips/api_update_ip_pool.go | 84 ++++++++ rest/api/v3/ips/docs/AddIp.md | 48 +++++ rest/api/v3/ips/docs/AddIp201Response.md | 13 ++ .../v3/ips/docs/AddIp201ResponseIpsInner.md | 12 ++ rest/api/v3/ips/docs/AddIpRequest.md | 13 ++ rest/api/v3/ips/docs/AddIpToIpPool.md | 52 +++++ .../v3/ips/docs/AddIpToIpPool201Response.md | 14 ++ .../v3/ips/docs/AddIpToIpPool404Response.md | 11 ++ .../AddIpToIpPool404ResponseErrorsInner.md | 12 ++ rest/api/v3/ips/docs/AddIpToIpPoolRequest.md | 11 ++ rest/api/v3/ips/docs/CreateIpPool.md | 48 +++++ rest/api/v3/ips/docs/CreateIpPoolRequest.md | 11 ++ rest/api/v3/ips/docs/DeleteIpFromIpPool.md | 52 +++++ .../ips/docs/DeleteIpFromIpPool404Response.md | 11 ++ rest/api/v3/ips/docs/DeleteIpPool.md | 51 +++++ .../v3/ips/docs/DeleteIpPool404Response.md | 11 ++ rest/api/v3/ips/docs/ErrorResponse.md | 12 ++ .../v3/ips/docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/ips/docs/GetIp.md | 51 +++++ rest/api/v3/ips/docs/GetIp200Response.md | 17 ++ rest/api/v3/ips/docs/GetIpPool.md | 51 +++++ rest/api/v3/ips/docs/GetIpPool200Response.md | 12 ++ rest/api/v3/ips/docs/GetIpPool404Response.md | 11 ++ .../docs/GetIpPool404ResponseErrorsInner.md | 12 ++ rest/api/v3/ips/docs/IpPools200.md | 11 ++ rest/api/v3/ips/docs/ListAssignedIp.md | 44 +++++ .../docs/ListAssignedIp200ResponseInner.md | 14 ++ rest/api/v3/ips/docs/ListIp.md | 53 +++++ .../api/v3/ips/docs/ListIp200ResponseInner.md | 18 ++ rest/api/v3/ips/docs/ListIpPool.md | 44 +++++ rest/api/v3/ips/docs/ListRemainingIpCount.md | 44 +++++ .../docs/ListRemainingIpCount200Response.md | 11 ++ ...RemainingIpCount200ResponseResultsInner.md | 13 ++ rest/api/v3/ips/docs/SortByDirection.md | 13 ++ rest/api/v3/ips/docs/UpdateIpPool.md | 52 +++++ .../v3/ips/docs/UpdateIpPool404Response.md | 11 ++ .../UpdateIpPool404ResponseErrorsInner.md | 12 ++ rest/api/v3/ips/docs/UpdateIpPoolRequest.md | 11 ++ rest/api/v3/ips/model_add_ip_201_response.go | 24 +++ .../model_add_ip_201_response_ips_inner.go | 22 +++ rest/api/v3/ips/model_add_ip_request.go | 24 +++ .../model_add_ip_to_ip_pool_201_response.go | 26 +++ .../model_add_ip_to_ip_pool_404_response.go | 20 ++ ...ip_to_ip_pool_404_response_errors_inner.go | 21 ++ .../v3/ips/model_add_ip_to_ip_pool_request.go | 20 ++ .../v3/ips/model_create_ip_pool_request.go | 20 ++ ...del_delete_ip_from_ip_pool_404_response.go | 20 ++ .../ips/model_delete_ip_pool_404_response.go | 20 ++ rest/api/v3/ips/model_error_response.go | 21 ++ .../ips/model_error_response_errors_inner.go | 24 +++ rest/api/v3/ips/model_get_ip_200_response.go | 32 +++ .../v3/ips/model_get_ip_pool_200_response.go | 22 +++ .../v3/ips/model_get_ip_pool_404_response.go | 19 ++ ...l_get_ip_pool_404_response_errors_inner.go | 22 +++ rest/api/v3/ips/model_ip_pools200.go | 20 ++ ...del_list_assigned_ip_200_response_inner.go | 26 +++ .../ips/model_list_ip_200_response_inner.go | 34 ++++ ...el_list_remaining_ip_count_200_response.go | 19 ++ ...ing_ip_count_200_response_results_inner.go | 24 +++ rest/api/v3/ips/model_sort_by_direction.go | 23 +++ .../ips/model_update_ip_pool_404_response.go | 19 ++ ...pdate_ip_pool_404_response_errors_inner.go | 21 ++ .../v3/ips/model_update_ip_pool_request.go | 20 ++ rest/api/v3/link_branding/README.md | 98 ++++++++++ ...api_associate_branded_link_with_subuser.go | 77 ++++++++ .../link_branding/api_create_branded_link.go | 74 +++++++ .../link_branding/api_delete_branded_link.go | 71 +++++++ ..._disassociate_branded_link_from_subuser.go | 60 ++++++ .../v3/link_branding/api_get_branded_link.go | 71 +++++++ .../v3/link_branding/api_list_branded_link.go | 70 +++++++ .../api_list_default_branded_link.go | 69 +++++++ .../api_list_subuser_branded_link.go | 60 ++++++ rest/api/v3/link_branding/api_service.go | 34 ++++ .../link_branding/api_update_branded_link.go | 86 ++++++++ .../api_validate_branded_link.go | 79 ++++++++ .../docs/AssociateBrandedLinkWithSubuser.md | 52 +++++ .../AssociateBrandedLinkWithSubuserRequest.md | 11 ++ .../link_branding/docs/CreateBrandedLink.md | 49 +++++ .../docs/CreateBrandedLinkRequest.md | 14 ++ rest/api/v3/link_branding/docs/Default.md | 13 ++ rest/api/v3/link_branding/docs/Default1.md | 13 ++ rest/api/v3/link_branding/docs/Default2.md | 13 ++ .../link_branding/docs/DeleteBrandedLink.md | 52 +++++ .../DisassociateBrandedLinkFromSubuser.md | 47 +++++ .../v3/link_branding/docs/GetBrandedLink.md | 52 +++++ rest/api/v3/link_branding/docs/Legacy.md | 13 ++ .../v3/link_branding/docs/LinkBranding200.md | 19 ++ .../link_branding/docs/LinkBranding200Dns.md | 12 ++ .../docs/LinkBranding200DnsDomainCname.md | 14 ++ .../docs/LinkBranding200DnsOwnerCname.md | 14 ++ .../v3/link_branding/docs/ListBrandedLink.md | 49 +++++ .../docs/ListDefaultBrandedLink.md | 49 +++++ .../docs/ListSubuserBrandedLink.md | 47 +++++ rest/api/v3/link_branding/docs/Region.md | 13 ++ rest/api/v3/link_branding/docs/Type.md | 14 ++ rest/api/v3/link_branding/docs/Type1.md | 14 ++ .../link_branding/docs/UpdateBrandedLink.md | 53 +++++ .../docs/UpdateBrandedLinkRequest.md | 11 ++ rest/api/v3/link_branding/docs/Valid.md | 13 ++ rest/api/v3/link_branding/docs/Valid1.md | 13 ++ rest/api/v3/link_branding/docs/Valid2.md | 13 ++ rest/api/v3/link_branding/docs/Valid3.md | 13 ++ rest/api/v3/link_branding/docs/Valid4.md | 13 ++ rest/api/v3/link_branding/docs/Valid5.md | 13 ++ .../link_branding/docs/ValidateBrandedLink.md | 52 +++++ .../docs/ValidateBrandedLink200Response.md | 13 ++ ...BrandedLink200ResponseValidationResults.md | 12 ++ ...200ResponseValidationResultsDomainCname.md | 12 ++ ...k200ResponseValidationResultsOwnerCname.md | 12 ++ .../docs/ValidateBrandedLink500Response.md | 11 ++ ...lidateBrandedLink500ResponseErrorsInner.md | 11 ++ ...ciate_branded_link_with_subuser_request.go | 20 ++ .../model_create_branded_link_request.go | 26 +++ rest/api/v3/link_branding/model_default.go | 23 +++ rest/api/v3/link_branding/model_default1.go | 23 +++ rest/api/v3/link_branding/model_default2.go | 23 +++ rest/api/v3/link_branding/model_legacy.go | 23 +++ .../link_branding/model_link_branding200.go | 35 ++++ .../model_link_branding200_dns.go | 20 ++ ...model_link_branding200_dns_domain_cname.go | 26 +++ .../model_link_branding200_dns_owner_cname.go | 26 +++ rest/api/v3/link_branding/model_region.go | 23 +++ rest/api/v3/link_branding/model_type.go | 24 +++ rest/api/v3/link_branding/model_type1.go | 24 +++ .../model_update_branded_link_request.go | 20 ++ rest/api/v3/link_branding/model_valid.go | 23 +++ rest/api/v3/link_branding/model_valid1.go | 23 +++ rest/api/v3/link_branding/model_valid2.go | 23 +++ rest/api/v3/link_branding/model_valid3.go | 23 +++ rest/api/v3/link_branding/model_valid4.go | 23 +++ rest/api/v3/link_branding/model_valid5.go | 23 +++ ...odel_validate_branded_link_200_response.go | 23 +++ ...ed_link_200_response_validation_results.go | 20 ++ ...esponse_validation_results_domain_cname.go | 22 +++ ...response_validation_results_owner_cname.go | 22 +++ ...odel_validate_branded_link_500_response.go | 20 ++ ..._branded_link_500_response_errors_inner.go | 20 ++ rest/api/v3/lmc_campaigns/README.md | 88 +++++++++ .../v3/lmc_campaigns/api_create_campaign.go | 90 +++++++++ .../v3/lmc_campaigns/api_delete_campaign.go | 79 ++++++++ rest/api/v3/lmc_campaigns/api_get_campaign.go | 87 +++++++++ .../api_get_scheduled_campaign.go | 79 ++++++++ .../api/v3/lmc_campaigns/api_list_campaign.go | 79 ++++++++ .../v3/lmc_campaigns/api_schedule_campaign.go | 118 +++++++++++ .../api/v3/lmc_campaigns/api_send_campaign.go | 103 ++++++++++ .../lmc_campaigns/api_send_test_campaign.go | 102 ++++++++++ rest/api/v3/lmc_campaigns/api_service.go | 34 ++++ .../lmc_campaigns/api_un_schedule_campaign.go | 79 ++++++++ .../v3/lmc_campaigns/api_update_campaign.go | 118 +++++++++++ .../api_update_scheduled_campaign.go | 110 +++++++++++ .../api/v3/lmc_campaigns/docs/Campaigns2xx.md | 24 +++ .../v3/lmc_campaigns/docs/CreateCampaign.md | 49 +++++ .../v3/lmc_campaigns/docs/DeleteCampaign.md | 52 +++++ rest/api/v3/lmc_campaigns/docs/Editor.md | 13 ++ .../v3/lmc_campaigns/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/lmc_campaigns/docs/GetCampaign.md | 52 +++++ .../docs/GetCampaign200Response.md | 23 +++ .../docs/GetScheduledCampaign.md | 52 +++++ .../api/v3/lmc_campaigns/docs/ListCampaign.md | 50 +++++ .../docs/ListCampaign200Response.md | 11 ++ .../docs/PostCampaignsRequest.md | 22 +++ .../docs/ScheduleACampaignRequest.md | 11 ++ .../docs/ScheduleACampaignResponse.md | 13 ++ .../v3/lmc_campaigns/docs/ScheduleCampaign.md | 53 +++++ .../docs/SendACampaignResponse.md | 12 ++ .../docs/SendATestCampaignRequest.md | 11 ++ .../api/v3/lmc_campaigns/docs/SendCampaign.md | 52 +++++ .../v3/lmc_campaigns/docs/SendTestCampaign.md | 53 +++++ .../docs/SendTestCampaignRequest.md | 11 ++ rest/api/v3/lmc_campaigns/docs/Status.md | 12 ++ .../lmc_campaigns/docs/UnScheduleCampaign.md | 52 +++++ .../docs/UpdateACampaignRequest.md | 15 ++ .../docs/UpdateAScheduledCampaignRequest.md | 11 ++ .../docs/UpdateAScheduledCampaignResponse.md | 13 ++ .../v3/lmc_campaigns/docs/UpdateCampaign.md | 53 +++++ .../docs/UpdateScheduledCampaign.md | 53 +++++ .../ViewScheduledTimeOfACampaignResponse.md | 11 ++ .../v3/lmc_campaigns/model_campaigns2xx.go | 45 +++++ rest/api/v3/lmc_campaigns/model_editor.go | 23 +++ .../v3/lmc_campaigns/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../model_get_campaign_200_response.go | 31 +++ .../model_list_campaign_200_response.go | 19 ++ .../model_post_campaigns_request.go | 42 ++++ .../model_schedule_a_campaign_request.go | 20 ++ .../model_schedule_a_campaign_response.go | 24 +++ .../model_send_a_campaign_response.go | 20 ++ .../model_send_a_test_campaign_request.go | 19 ++ .../model_send_test_campaign_request.go | 20 ++ rest/api/v3/lmc_campaigns/model_status.go | 22 +++ .../model_update_a_campaign_request.go | 28 +++ ...del_update_a_scheduled_campaign_request.go | 19 ++ ...el_update_a_scheduled_campaign_response.go | 24 +++ ...w_scheduled_time_of_a_campaign_response.go | 19 ++ rest/api/v3/lmc_contactdb/README.md | 134 +++++++++++++ .../api/v3/lmc_contactdb/api_add_recipient.go | 90 +++++++++ .../api_add_recipient_to_contact_db_list.go | 96 +++++++++ .../api_add_recipients_to_contact_db_list.go | 102 ++++++++++ .../api_create_contact_db_list.go | 90 +++++++++ .../lmc_contactdb/api_create_custom_field.go | 82 ++++++++ .../v3/lmc_contactdb/api_create_segment.go | 90 +++++++++ .../api_delete_contact_db_list.go | 111 +++++++++++ .../api_delete_contact_db_lists.go | 82 ++++++++ .../lmc_contactdb/api_delete_custom_field.go | 95 +++++++++ .../v3/lmc_contactdb/api_delete_recipient.go | 94 +++++++++ ...i_delete_recipient_from_contact_db_list.go | 111 +++++++++++ .../v3/lmc_contactdb/api_delete_recipients.go | 90 +++++++++ .../v3/lmc_contactdb/api_delete_segment.go | 111 +++++++++++ rest/api/v3/lmc_contactdb/api_get_billable.go | 67 +++++++ .../lmc_contactdb/api_get_contact_db_list.go | 95 +++++++++ .../v3/lmc_contactdb/api_get_custom_field.go | 95 +++++++++ .../api/v3/lmc_contactdb/api_get_recipient.go | 94 +++++++++ .../lmc_contactdb/api_get_recipient_list.go | 94 +++++++++ rest/api/v3/lmc_contactdb/api_get_segment.go | 95 +++++++++ .../lmc_contactdb/api_list_contact_db_list.go | 59 ++++++ .../v3/lmc_contactdb/api_list_custom_field.go | 67 +++++++ .../v3/lmc_contactdb/api_list_recipient.go | 95 +++++++++ .../lmc_contactdb/api_list_recipient_count.go | 67 +++++++ .../api_list_recipient_for_segment.go | 114 +++++++++++ ...pi_list_recipients_from_contact_db_list.go | 106 ++++++++++ .../lmc_contactdb/api_list_reserved_field.go | 67 +++++++ .../api_list_search_recipient.go | 85 ++++++++ rest/api/v3/lmc_contactdb/api_list_segment.go | 67 +++++++ rest/api/v3/lmc_contactdb/api_list_status.go | 59 ++++++ .../v3/lmc_contactdb/api_search_recipient.go | 65 +++++++ rest/api/v3/lmc_contactdb/api_service.go | 34 ++++ .../api_update_contact_db_list.go | 102 ++++++++++ .../v3/lmc_contactdb/api_update_recipient.go | 90 +++++++++ .../v3/lmc_contactdb/api_update_segment.go | 102 ++++++++++ .../api/v3/lmc_contactdb/docs/AddRecipient.md | 49 +++++ .../docs/AddRecipientRequestInner.md | 14 ++ .../docs/AddRecipientToContactDbList.md | 53 +++++ .../docs/AddRecipientsToContactDbList.md | 53 +++++ rest/api/v3/lmc_contactdb/docs/AndOr.md | 14 ++ .../docs/ContactdbCustomField.md | 12 ++ .../docs/ContactdbCustomFieldId2xx.md | 13 ++ .../docs/ContactdbCustomFieldIdValue.md | 14 ++ .../v3/lmc_contactdb/docs/ContactdbList2xx.md | 13 ++ .../docs/ContactdbRecipient200.md | 11 ++ .../ContactdbRecipient200RecipientsInner.md | 20 ++ .../docs/ContactdbRecipientCount200.md | 11 ++ .../docs/ContactdbRecipientResponse201.md | 16 ++ ...ontactdbRecipientResponse201ErrorsInner.md | 12 ++ .../lmc_contactdb/docs/ContactdbSegments.md | 14 ++ .../docs/ContactdbSegmentsConditions.md | 14 ++ .../docs/ContactdbSegmentsId200.md | 15 ++ .../lmc_contactdb/docs/CreateAListRequest.md | 11 ++ .../lmc_contactdb/docs/CreateContactDbList.md | 49 +++++ .../lmc_contactdb/docs/CreateCustomField.md | 49 +++++ .../docs/CreateCustomFieldRequest.md | 12 ++ .../v3/lmc_contactdb/docs/CreateSegment.md | 49 +++++ .../lmc_contactdb/docs/DeleteContactDbList.md | 54 +++++ .../docs/DeleteContactDbLists.md | 49 +++++ .../v3/lmc_contactdb/docs/DeleteContacts.md | 13 ++ .../lmc_contactdb/docs/DeleteCustomField.md | 52 +++++ .../v3/lmc_contactdb/docs/DeleteRecipient.md | 52 +++++ .../docs/DeleteRecipientFromContactDbList.md | 54 +++++ .../v3/lmc_contactdb/docs/DeleteRecipients.md | 49 +++++ .../v3/lmc_contactdb/docs/DeleteSegment.md | 54 +++++ .../v3/lmc_contactdb/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/lmc_contactdb/docs/GetBillable.md | 48 +++++ .../v3/lmc_contactdb/docs/GetContactDbList.md | 52 +++++ .../v3/lmc_contactdb/docs/GetCustomField.md | 52 +++++ .../api/v3/lmc_contactdb/docs/GetRecipient.md | 52 +++++ .../v3/lmc_contactdb/docs/GetRecipientList.md | 52 +++++ .../docs/GetRecipientList200Response.md | 11 ++ rest/api/v3/lmc_contactdb/docs/GetSegment.md | 52 +++++ .../docs/ListAllCustomFieldsResponse.md | 11 ++ .../docs/ListAllListsResponse.md | 11 ++ .../docs/ListAllSegmentsResponse.md | 11 ++ .../lmc_contactdb/docs/ListContactDbList.md | 48 +++++ .../v3/lmc_contactdb/docs/ListCustomField.md | 48 +++++ .../v3/lmc_contactdb/docs/ListRecipient.md | 50 +++++ .../lmc_contactdb/docs/ListRecipientCount.md | 48 +++++ .../docs/ListRecipientForSegment.md | 54 +++++ .../docs/ListRecipientsFromContactDbList.md | 54 +++++ ...tRecipientsFromContactDbList200Response.md | 11 ++ .../docs/ListRecipientsOnASegmentResponse.md | 11 ++ .../docs/ListRecipientsResponse.md | 11 ++ .../lmc_contactdb/docs/ListReservedField.md | 48 +++++ .../docs/ListReservedField200Response.md | 11 ++ ...rvedField200ResponseReservedFieldsInner.md | 12 ++ .../lmc_contactdb/docs/ListSearchRecipient.md | 49 +++++ rest/api/v3/lmc_contactdb/docs/ListSegment.md | 48 +++++ rest/api/v3/lmc_contactdb/docs/ListStatus.md | 48 +++++ .../docs/ListStatus200Response.md | 11 ++ .../docs/ListStatus200ResponseStatusInner.md | 12 ++ rest/api/v3/lmc_contactdb/docs/Operator.md | 16 ++ .../v3/lmc_contactdb/docs/SearchRecipient.md | 48 +++++ .../docs/SearchRecipient200Response.md | 12 ++ ...archRecipient200ResponseRecipientsInner.md | 19 ++ ...esponseRecipientsInnerCustomFieldsInner.md | 14 ++ ...seRecipientsInnerCustomFieldsInnerValue.md | 10 + .../docs/SearchRecipientRequest.md | 12 ++ rest/api/v3/lmc_contactdb/docs/Type.md | 14 ++ .../lmc_contactdb/docs/UpdateAListRequest.md | 11 ++ .../lmc_contactdb/docs/UpdateContactDbList.md | 53 +++++ .../docs/UpdateContactDbList200Response.md | 13 ++ .../v3/lmc_contactdb/docs/UpdateRecipient.md | 49 +++++ .../docs/UpdateRecipientRequestInner.md | 13 ++ .../v3/lmc_contactdb/docs/UpdateSegment.md | 53 +++++ .../docs/UpdateSegmentRequest.md | 13 ++ .../model_add_recipient_request_inner.go | 25 +++ rest/api/v3/lmc_contactdb/model_and_or.go | 24 +++ .../model_contactdb_custom_field.go | 22 +++ .../model_contactdb_custom_field_id2xx.go | 24 +++ .../model_contactdb_custom_field_id_value.go | 26 +++ .../lmc_contactdb/model_contactdb_list2xx.go | 24 +++ .../model_contactdb_recipient200.go | 19 ++ ...contactdb_recipient200_recipients_inner.go | 38 ++++ .../model_contactdb_recipient_count200.go | 20 ++ .../model_contactdb_recipient_response201.go | 29 +++ ...ctdb_recipient_response201_errors_inner.go | 20 ++ .../lmc_contactdb/model_contactdb_segments.go | 26 +++ .../model_contactdb_segments_conditions.go | 22 +++ .../model_contactdb_segments_id200.go | 28 +++ .../model_create_a_list_request.go | 19 ++ .../model_create_custom_field_request.go | 20 ++ .../v3/lmc_contactdb/model_delete_contacts.go | 23 +++ .../v3/lmc_contactdb/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../model_get_recipient_list_200_response.go | 19 ++ .../model_list_all_custom_fields_response.go | 19 ++ .../model_list_all_lists_response.go | 19 ++ .../model_list_all_segments_response.go | 19 ++ ...ients_from_contact_db_list_200_response.go | 19 ++ ...l_list_recipients_on_a_segment_response.go | 19 ++ .../model_list_recipients_response.go | 19 ++ .../model_list_reserved_field_200_response.go | 19 ++ ...ield_200_response_reserved_fields_inner.go | 20 ++ .../model_list_status_200_response.go | 19 ++ ...l_list_status_200_response_status_inner.go | 22 +++ rest/api/v3/lmc_contactdb/model_operator.go | 26 +++ .../model_search_recipient_200_response.go | 20 ++ ...recipient_200_response_recipients_inner.go | 27 +++ ...se_recipients_inner_custom_fields_inner.go | 22 +++ ...ipients_inner_custom_fields_inner_value.go | 18 ++ .../model_search_recipient_request.go | 21 ++ rest/api/v3/lmc_contactdb/model_type.go | 24 +++ .../model_update_a_list_request.go | 20 ++ ...del_update_contact_db_list_200_response.go | 24 +++ .../model_update_recipient_request_inner.go | 23 +++ .../model_update_segment_request.go | 23 +++ rest/api/v3/lmc_senders/README.md | 74 +++++++ rest/api/v3/lmc_senders/api_create_sender.go | 82 ++++++++ rest/api/v3/lmc_senders/api_delete_sender.go | 87 +++++++++ rest/api/v3/lmc_senders/api_get_sender.go | 79 ++++++++ rest/api/v3/lmc_senders/api_list_sender.go | 59 ++++++ .../api_reset_sender_verification.go | 87 +++++++++ rest/api/v3/lmc_senders/api_service.go | 34 ++++ rest/api/v3/lmc_senders/api_update_sender.go | 110 +++++++++++ rest/api/v3/lmc_senders/docs/CreateSender.md | 49 +++++ .../docs/CreateSender400Response.md | 11 ++ .../CreateSender400ResponseErrorsInner.md | 12 ++ .../lmc_senders/docs/CreateSenderRequest.md | 19 ++ rest/api/v3/lmc_senders/docs/DeleteSender.md | 52 +++++ rest/api/v3/lmc_senders/docs/GetSender.md | 52 +++++ rest/api/v3/lmc_senders/docs/ListSender.md | 48 +++++ .../lmc_senders/docs/ListSender200Response.md | 11 ++ .../docs/ResetSenderVerification.md | 52 +++++ rest/api/v3/lmc_senders/docs/SenderId.md | 24 +++ .../v3/lmc_senders/docs/SenderIdRequest.md | 19 ++ .../lmc_senders/docs/SenderIdRequestFrom.md | 12 ++ .../docs/SenderIdRequestReplyTo.md | 12 ++ rest/api/v3/lmc_senders/docs/UpdateSender.md | 53 +++++ .../model_create_sender_400_response.go | 19 ++ ...create_sender_400_response_errors_inner.go | 20 ++ .../model_create_sender_request.go | 34 ++++ .../model_list_sender_200_response.go | 19 ++ rest/api/v3/lmc_senders/model_sender_id.go | 44 +++++ .../v3/lmc_senders/model_sender_id_request.go | 34 ++++ .../model_sender_id_request_from.go | 22 +++ .../model_sender_id_request_reply_to.go | 22 +++ rest/api/v3/mail/README.md | 85 ++++++++ rest/api/v3/mail/api_create_mail_batch.go | 107 ++++++++++ rest/api/v3/mail/api_get_mail_batch.go | 99 ++++++++++ rest/api/v3/mail/api_send_mail.go | 122 ++++++++++++ rest/api/v3/mail/api_service.go | 34 ++++ rest/api/v3/mail/docs/ContentEncoding.md | 12 ++ rest/api/v3/mail/docs/CreateMailBatch.md | 48 +++++ rest/api/v3/mail/docs/Disposition.md | 13 ++ rest/api/v3/mail/docs/ErrorResponse.md | 12 ++ .../v3/mail/docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/mail/docs/GetMailBatch.md | 48 +++++ rest/api/v3/mail/docs/MailBatchResponse.md | 11 ++ rest/api/v3/mail/docs/MailFrom.md | 12 ++ rest/api/v3/mail/docs/MailTo.md | 12 ++ rest/api/v3/mail/docs/SendMail.md | 49 +++++ rest/api/v3/mail/docs/SendMailRequest.md | 27 +++ rest/api/v3/mail/docs/SendMailRequestAsm.md | 12 ++ .../docs/SendMailRequestAttachmentsInner.md | 15 ++ .../mail/docs/SendMailRequestContentInner.md | 12 ++ .../mail/docs/SendMailRequestMailSettings.md | 16 ++ ...questMailSettingsBypassBounceManagement.md | 11 ++ ...RequestMailSettingsBypassListManagement.md | 11 ++ ...RequestMailSettingsBypassSpamManagement.md | 11 ++ ...MailSettingsBypassUnsubscribeManagement.md | 11 ++ .../docs/SendMailRequestMailSettingsFooter.md | 13 ++ .../SendMailRequestMailSettingsSandboxMode.md | 11 ++ .../SendMailRequestPersonalizationsInner.md | 20 ++ .../docs/SendMailRequestTrackingSettings.md | 14 ++ ...ailRequestTrackingSettingsClickTracking.md | 12 ++ ...ndMailRequestTrackingSettingsGanalytics.md | 16 ++ ...MailRequestTrackingSettingsOpenTracking.md | 12 ++ ...estTrackingSettingsSubscriptionTracking.md | 14 ++ rest/api/v3/mail/model_content_encoding.go | 22 +++ rest/api/v3/mail/model_disposition.go | 23 +++ rest/api/v3/mail/model_error_response.go | 21 ++ .../mail/model_error_response_errors_inner.go | 24 +++ rest/api/v3/mail/model_mail_batch_response.go | 20 ++ rest/api/v3/mail/model_mail_from.go | 22 +++ rest/api/v3/mail/model_mail_to.go | 22 +++ rest/api/v3/mail/model_send_mail_request.go | 47 +++++ .../v3/mail/model_send_mail_request_asm.go | 22 +++ ...del_send_mail_request_attachments_inner.go | 28 +++ .../model_send_mail_request_content_inner.go | 22 +++ .../model_send_mail_request_mail_settings.go | 24 +++ ..._mail_settings_bypass_bounce_management.go | 20 ++ ...st_mail_settings_bypass_list_management.go | 20 ++ ...st_mail_settings_bypass_spam_management.go | 20 ++ ..._settings_bypass_unsubscribe_management.go | 20 ++ ..._send_mail_request_mail_settings_footer.go | 24 +++ ...mail_request_mail_settings_sandbox_mode.go | 20 ++ ...end_mail_request_personalizations_inner.go | 37 ++++ ...del_send_mail_request_tracking_settings.go | 22 +++ ...equest_tracking_settings_click_tracking.go | 22 +++ ...il_request_tracking_settings_ganalytics.go | 30 +++ ...request_tracking_settings_open_tracking.go | 22 +++ ...tracking_settings_subscription_tracking.go | 26 +++ rest/api/v3/mail_settings/README.md | 86 ++++++++ .../api_list_address_whitelist.go | 59 ++++++ .../v3/mail_settings/api_list_bounce_purge.go | 59 ++++++ rest/api/v3/mail_settings/api_list_footer.go | 59 ++++++ .../mail_settings/api_list_forward_bounce.go | 59 ++++++ .../v3/mail_settings/api_list_forward_spam.go | 59 ++++++ .../v3/mail_settings/api_list_mail_setting.go | 79 ++++++++ .../api/v3/mail_settings/api_list_template.go | 59 ++++++ rest/api/v3/mail_settings/api_service.go | 34 ++++ .../api_update_address_whitelist.go | 74 +++++++ .../mail_settings/api_update_bounce_purge.go | 74 +++++++ .../api/v3/mail_settings/api_update_footer.go | 74 +++++++ .../api_update_forward_bounce.go | 74 +++++++ .../mail_settings/api_update_forward_spam.go | 74 +++++++ .../v3/mail_settings/api_update_template.go | 74 +++++++ .../docs/ListAddressWhitelist.md | 48 +++++ .../v3/mail_settings/docs/ListBouncePurge.md | 48 +++++ rest/api/v3/mail_settings/docs/ListFooter.md | 48 +++++ .../mail_settings/docs/ListForwardBounce.md | 48 +++++ .../v3/mail_settings/docs/ListForwardSpam.md | 48 +++++ .../v3/mail_settings/docs/ListMailSetting.md | 50 +++++ .../docs/ListMailSetting200Response.md | 11 ++ .../ListMailSetting200ResponseResultInner.md | 14 ++ .../api/v3/mail_settings/docs/ListTemplate.md | 48 +++++ .../docs/MailSettingsAddressWhitelabel200.md | 12 ++ .../docs/MailSettingsBouncePurge.md | 13 ++ .../mail_settings/docs/MailSettingsFooter.md | 13 ++ .../docs/MailSettingsForwardBounce.md | 12 ++ .../docs/MailSettingsForwardSpam.md | 12 ++ .../docs/MailSettingsTemplate200.md | 12 ++ .../docs/UpdateAddressWhitelist.md | 49 +++++ .../docs/UpdateAddressWhitelistRequest.md | 12 ++ .../mail_settings/docs/UpdateBouncePurge.md | 49 +++++ .../api/v3/mail_settings/docs/UpdateFooter.md | 49 +++++ .../mail_settings/docs/UpdateForwardBounce.md | 49 +++++ .../mail_settings/docs/UpdateForwardSpam.md | 49 +++++ .../v3/mail_settings/docs/UpdateTemplate.md | 49 +++++ .../docs/UpdateTemplate200Response.md | 12 ++ .../docs/UpdateTemplateRequest.md | 12 ++ .../model_list_mail_setting_200_response.go | 20 ++ ..._mail_setting_200_response_result_inner.go | 26 +++ ...del_mail_settings_address_whitelabel200.go | 22 +++ .../model_mail_settings_bounce_purge.go | 24 +++ .../model_mail_settings_footer.go | 24 +++ .../model_mail_settings_forward_bounce.go | 22 +++ .../model_mail_settings_forward_spam.go | 22 +++ .../model_mail_settings_template200.go | 22 +++ .../model_update_address_whitelist_request.go | 22 +++ .../model_update_template_200_response.go | 22 +++ .../model_update_template_request.go | 22 +++ rest/api/v3/mc_custom_fields/README.md | 78 ++++++++ .../api_create_field_definition.go | 73 +++++++ .../api_delete_field_definition.go | 61 ++++++ .../api_list_field_definition.go | 49 +++++ rest/api/v3/mc_custom_fields/api_service.go | 34 ++++ .../api_update_field_definition.go | 92 +++++++++ .../docs/CreateFieldDefinition.md | 48 +++++ .../docs/CreateFieldDefinition200Response.md | 14 ++ .../docs/CreateFieldDefinition400Response.md | 11 ++ .../docs/CreateFieldDefinitionRequest.md | 12 ++ .../docs/CustomFieldDefinitionsResponse.md | 13 ++ .../docs/CustomFieldsError.md | 14 ++ .../docs/DeleteFieldDefinition.md | 51 +++++ .../api/v3/mc_custom_fields/docs/FieldType.md | 14 ++ .../v3/mc_custom_fields/docs/FieldType1.md | 14 ++ .../v3/mc_custom_fields/docs/FieldType2.md | 14 ++ .../docs/ListFieldDefinition.md | 44 +++++ .../docs/ListFieldDefinition200Response.md | 13 ++ rest/api/v3/mc_custom_fields/docs/Metadata.md | 14 ++ .../ReservedFieldDefinitionsResponseInner.md | 13 ++ .../docs/UpdateFieldDefinition.md | 52 +++++ .../docs/UpdateFieldDefinitionRequest.md | 11 ++ ...el_create_field_definition_200_response.go | 22 +++ ...el_create_field_definition_400_response.go | 19 ++ .../model_create_field_definition_request.go | 20 ++ ...model_custom_field_definitions_response.go | 21 ++ .../model_custom_fields_error.go | 22 +++ .../v3/mc_custom_fields/model_field_type.go | 24 +++ .../v3/mc_custom_fields/model_field_type1.go | 24 +++ .../v3/mc_custom_fields/model_field_type2.go | 24 +++ ...odel_list_field_definition_200_response.go | 21 ++ .../api/v3/mc_custom_fields/model_metadata.go | 22 +++ ...served_field_definitions_response_inner.go | 22 +++ .../model_update_field_definition_request.go | 19 ++ rest/api/v3/mc_designs/README.md | 84 ++++++++ rest/api/v3/mc_designs/api_create_design.go | 73 +++++++ rest/api/v3/mc_designs/api_delete_design.go | 77 ++++++++ .../api/v3/mc_designs/api_duplicate_design.go | 92 +++++++++ .../api_duplicate_pre_built_design.go | 92 +++++++++ rest/api/v3/mc_designs/api_get_design.go | 77 ++++++++ .../v3/mc_designs/api_get_pre_built_design.go | 77 ++++++++ rest/api/v3/mc_designs/api_list_design.go | 79 ++++++++ .../mc_designs/api_list_pre_built_design.go | 79 ++++++++ rest/api/v3/mc_designs/api_service.go | 34 ++++ rest/api/v3/mc_designs/api_update_design.go | 92 +++++++++ rest/api/v3/mc_designs/docs/ApiError.md | 13 ++ rest/api/v3/mc_designs/docs/ApiErrors.md | 11 ++ rest/api/v3/mc_designs/docs/CreateDesign.md | 48 +++++ rest/api/v3/mc_designs/docs/DeleteDesign.md | 51 +++++ .../mc_designs/docs/DesignCommonProperties.md | 15 ++ .../mc_designs/docs/DesignDuplicateInput.md | 12 ++ rest/api/v3/mc_designs/docs/DesignInput.md | 14 ++ rest/api/v3/mc_designs/docs/DesignOutput.md | 14 ++ .../v3/mc_designs/docs/DesignOutputSummary.md | 16 ++ .../api/v3/mc_designs/docs/DuplicateDesign.md | 52 +++++ .../docs/DuplicatePreBuiltDesign.md | 52 +++++ rest/api/v3/mc_designs/docs/Editor.md | 13 ++ rest/api/v3/mc_designs/docs/GetDesign.md | 51 +++++ .../v3/mc_designs/docs/GetPreBuiltDesign.md | 51 +++++ rest/api/v3/mc_designs/docs/ListDesign.md | 50 +++++ .../mc_designs/docs/ListDesign200Response.md | 12 ++ .../v3/mc_designs/docs/ListPreBuiltDesign.md | 50 +++++ rest/api/v3/mc_designs/docs/Metadata.md | 14 ++ rest/api/v3/mc_designs/docs/UpdateDesign.md | 52 +++++ .../v3/mc_designs/docs/UpdateDesignRequest.md | 16 ++ rest/api/v3/mc_designs/model_api_error.go | 21 ++ rest/api/v3/mc_designs/model_api_errors.go | 19 ++ .../model_design_common_properties.go | 28 +++ .../model_design_duplicate_input.go | 22 +++ rest/api/v3/mc_designs/model_design_input.go | 26 +++ rest/api/v3/mc_designs/model_design_output.go | 26 +++ .../mc_designs/model_design_output_summary.go | 30 +++ rest/api/v3/mc_designs/model_editor.go | 23 +++ .../model_list_design_200_response.go | 20 ++ rest/api/v3/mc_designs/model_metadata.go | 22 +++ .../mc_designs/model_update_design_request.go | 30 +++ rest/api/v3/mc_lists/README.md | 81 ++++++++ .../v3/mc_lists/api_create_marketing_list.go | 73 +++++++ rest/api/v3/mc_lists/api_delete_contact.go | 79 ++++++++ .../v3/mc_lists/api_delete_marketing_list.go | 89 +++++++++ .../api/v3/mc_lists/api_get_marketing_list.go | 80 ++++++++ .../api/v3/mc_lists/api_list_contact_count.go | 69 +++++++ .../v3/mc_lists/api_list_marketing_list.go | 70 +++++++ rest/api/v3/mc_lists/api_service.go | 34 ++++ .../v3/mc_lists/api_update_marketing_list.go | 92 +++++++++ rest/api/v3/mc_lists/docs/ContactDetails.md | 35 ++++ .../v3/mc_lists/docs/CreateMarketingList.md | 48 +++++ .../docs/CreateMarketingList400Response.md | 11 ++ .../docs/CreateMarketingListRequest.md | 11 ++ rest/api/v3/mc_lists/docs/DeleteContact.md | 51 +++++ .../mc_lists/docs/DeleteContact202Response.md | 11 ++ .../v3/mc_lists/docs/DeleteMarketingList.md | 52 +++++ .../docs/DeleteMarketingList200Response.md | 11 ++ .../docs/DeleteMarketingList404Response.md | 11 ++ rest/api/v3/mc_lists/docs/Error.md | 14 ++ rest/api/v3/mc_lists/docs/GetMarketingList.md | 52 +++++ .../docs/GetMarketingList200Response.md | 15 ++ rest/api/v3/mc_lists/docs/List.md | 14 ++ rest/api/v3/mc_lists/docs/ListContactCount.md | 51 +++++ .../docs/ListContactCount200Response.md | 12 ++ .../api/v3/mc_lists/docs/ListMarketingList.md | 49 +++++ .../docs/ListMarketingList200Response.md | 12 ++ rest/api/v3/mc_lists/docs/Metadata.md | 14 ++ rest/api/v3/mc_lists/docs/SelfMetadata.md | 11 ++ .../v3/mc_lists/docs/UpdateMarketingList.md | 52 +++++ .../docs/UpdateMarketingListRequest.md | 11 ++ rest/api/v3/mc_lists/model_contact_details.go | 47 +++++ ...odel_create_marketing_list_400_response.go | 19 ++ .../model_create_marketing_list_request.go | 20 ++ .../model_delete_contact_202_response.go | 20 ++ ...odel_delete_marketing_list_200_response.go | 20 ++ ...odel_delete_marketing_list_404_response.go | 19 ++ rest/api/v3/mc_lists/model_error.go | 22 +++ .../model_get_marketing_list_200_response.go | 26 +++ rest/api/v3/mc_lists/model_list.go | 25 +++ .../model_list_contact_count_200_response.go | 20 ++ .../model_list_marketing_list_200_response.go | 20 ++ rest/api/v3/mc_lists/model_metadata.go | 26 +++ rest/api/v3/mc_lists/model_self_metadata.go | 20 ++ .../model_update_marketing_list_request.go | 20 ++ rest/api/v3/mc_segments/README.md | 75 +++++++ rest/api/v3/mc_segments/api_delete_segment.go | 101 ++++++++++ rest/api/v3/mc_segments/api_get_segment.go | 104 ++++++++++ rest/api/v3/mc_segments/api_list_segment.go | 120 ++++++++++++ rest/api/v3/mc_segments/api_service.go | 34 ++++ .../v3/mc_segments/docs/ContactResponse.md | 27 +++ .../docs/ContactResponseCustomFields.md | 12 ++ rest/api/v3/mc_segments/docs/DeleteSegment.md | 51 +++++ rest/api/v3/mc_segments/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/mc_segments/docs/FullSegment.md | 22 +++ rest/api/v3/mc_segments/docs/GetSegment.md | 52 +++++ .../mc_segments/docs/GetSegment404Response.md | 11 ++ .../docs/GetSegment404ResponseErrorsInner.md | 12 ++ rest/api/v3/mc_segments/docs/ListSegment.md | 50 +++++ .../docs/ListSegment200Response.md | 11 ++ .../docs/ListSegment500Response.md | 11 ++ .../docs/ListSegment500ResponseErrorsInner.md | 11 ++ .../api/v3/mc_segments/docs/SegmentSummary.md | 18 ++ .../api/v3/mc_segments/docs/SegmentWriteV2.md | 13 ++ .../v3/mc_segments/model_contact_response.go | 51 +++++ .../model_contact_response_custom_fields.go | 20 ++ .../v3/mc_segments/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ rest/api/v3/mc_segments/model_full_segment.go | 43 ++++ .../model_get_segment_404_response.go | 19 ++ ...l_get_segment_404_response_errors_inner.go | 20 ++ .../model_list_segment_200_response.go | 19 ++ .../model_list_segment_500_response.go | 19 ++ ..._list_segment_500_response_errors_inner.go | 19 ++ .../v3/mc_segments/model_segment_summary.go | 35 ++++ .../v3/mc_segments/model_segment_write_v2.go | 24 +++ rest/api/v3/mc_segments_2/README.md | 87 +++++++++ .../v3/mc_segments_2/api_create_segment.go | 81 ++++++++ .../v3/mc_segments_2/api_delete_segment.go | 69 +++++++ rest/api/v3/mc_segments_2/api_get_segment.go | 88 +++++++++ rest/api/v3/mc_segments_2/api_list_segment.go | 104 ++++++++++ .../v3/mc_segments_2/api_refresh_segment.go | 92 +++++++++ rest/api/v3/mc_segments_2/api_service.go | 34 ++++ .../v3/mc_segments_2/api_update_segment.go | 92 +++++++++ .../v3/mc_segments_2/docs/AllSegments200.md | 21 ++ .../v3/mc_segments_2/docs/ContactResponse.md | 27 +++ .../docs/ContactResponseCustomFields.md | 12 ++ .../v3/mc_segments_2/docs/CreateSegment.md | 48 +++++ .../v3/mc_segments_2/docs/DeleteSegment.md | 51 +++++ .../v3/mc_segments_2/docs/ErrorsSegmentV2.md | 11 ++ .../docs/ErrorsSegmentV2ErrorsInner.md | 12 ++ rest/api/v3/mc_segments_2/docs/GetSegment.md | 52 +++++ rest/api/v3/mc_segments_2/docs/ListSegment.md | 50 +++++ rest/api/v3/mc_segments_2/docs/Metadata.md | 14 ++ .../v3/mc_segments_2/docs/RefreshSegment.md | 51 +++++ rest/api/v3/mc_segments_2/docs/Segment2xx.md | 25 +++ .../api/v3/mc_segments_2/docs/SegmentError.md | 11 ++ .../mc_segments_2/docs/SegmentRefresh202.md | 11 ++ .../docs/SegmentRefreshRequest.md | 11 ++ .../docs/SegmentStatusResponse.md | 12 ++ .../v3/mc_segments_2/docs/SegmentUpdate.md | 12 ++ .../v3/mc_segments_2/docs/SegmentWriteV2.md | 13 ++ .../v3/mc_segments_2/docs/UpdateSegment.md | 52 +++++ .../v3/mc_segments_2/model_all_segments200.go | 38 ++++ .../mc_segments_2/model_contact_response.go | 51 +++++ .../model_contact_response_custom_fields.go | 20 ++ .../mc_segments_2/model_errors_segment_v2.go | 19 ++ .../model_errors_segment_v2_errors_inner.go | 22 +++ rest/api/v3/mc_segments_2/model_metadata.go | 22 +++ rest/api/v3/mc_segments_2/model_segment2xx.go | 47 +++++ .../v3/mc_segments_2/model_segment_error.go | 20 ++ .../mc_segments_2/model_segment_refresh202.go | 20 ++ .../model_segment_refresh_request.go | 20 ++ .../model_segment_status_response.go | 22 +++ .../v3/mc_segments_2/model_segment_update.go | 22 +++ .../mc_segments_2/model_segment_write_v2.go | 24 +++ rest/api/v3/mc_senders/README.md | 74 +++++++ rest/api/v3/mc_senders/api_create_sender.go | 98 ++++++++++ rest/api/v3/mc_senders/api_delete_sender.go | 79 ++++++++ rest/api/v3/mc_senders/api_get_sender.go | 79 ++++++++ rest/api/v3/mc_senders/api_list_sender.go | 67 +++++++ .../api_reset_sender_verification.go | 79 ++++++++ rest/api/v3/mc_senders/api_service.go | 34 ++++ rest/api/v3/mc_senders/api_update_sender.go | 110 +++++++++++ rest/api/v3/mc_senders/docs/CreateSender.md | 49 +++++ .../v3/mc_senders/docs/CreateSenderRequest.md | 19 ++ .../docs/CreateSenderRequestFrom.md | 12 ++ .../docs/CreateSenderRequestReplyTo.md | 12 ++ rest/api/v3/mc_senders/docs/DeleteSender.md | 52 +++++ rest/api/v3/mc_senders/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/mc_senders/docs/GetSender.md | 52 +++++ rest/api/v3/mc_senders/docs/ListSender.md | 48 +++++ .../mc_senders/docs/ListSender200Response.md | 11 ++ .../docs/ResetSenderVerification.md | 52 +++++ rest/api/v3/mc_senders/docs/Sender.md | 24 +++ rest/api/v3/mc_senders/docs/SenderRequest.md | 19 ++ .../v3/mc_senders/docs/SenderRequestFrom.md | 12 ++ .../mc_senders/docs/SenderRequestReplyTo.md | 12 ++ rest/api/v3/mc_senders/docs/UpdateSender.md | 53 +++++ .../mc_senders/model_create_sender_request.go | 34 ++++ .../model_create_sender_request_from.go | 22 +++ .../model_create_sender_request_reply_to.go | 22 +++ .../api/v3/mc_senders/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../model_list_sender_200_response.go | 20 ++ rest/api/v3/mc_senders/model_sender.go | 44 +++++ .../api/v3/mc_senders/model_sender_request.go | 34 ++++ .../mc_senders/model_sender_request_from.go | 22 +++ .../model_sender_request_reply_to.go | 22 +++ rest/api/v3/mc_singlesends/README.md | 103 ++++++++++ .../mc_singlesends/api_create_single_send.go | 81 ++++++++ .../api_delete_scheduled_single_send.go | 77 ++++++++ .../mc_singlesends/api_delete_single_send.go | 69 +++++++ .../mc_singlesends/api_delete_single_sends.go | 77 ++++++++ .../api_duplicate_single_send.go | 92 +++++++++ .../v3/mc_singlesends/api_get_single_send.go | 77 ++++++++ .../v3/mc_singlesends/api_list_category.go | 57 ++++++ .../v3/mc_singlesends/api_list_single_send.go | 78 ++++++++ .../api_schedule_single_send.go | 92 +++++++++ .../mc_singlesends/api_search_single_send.go | 92 +++++++++ rest/api/v3/mc_singlesends/api_service.go | 34 ++++ .../mc_singlesends/api_update_single_send.go | 100 ++++++++++ .../v3/mc_singlesends/docs/AbTestSummary.md | 17 ++ .../mc_singlesends/docs/CreateSingleSend.md | 48 +++++ .../docs/DeleteScheduledSingleSend.md | 51 +++++ .../mc_singlesends/docs/DeleteSingleSend.md | 51 +++++ .../mc_singlesends/docs/DeleteSingleSends.md | 48 +++++ .../docs/DuplicateSingleSend.md | 52 +++++ .../docs/DuplicateSingleSendRequest.md | 11 ++ rest/api/v3/mc_singlesends/docs/Editor.md | 13 ++ rest/api/v3/mc_singlesends/docs/Editor1.md | 13 ++ .../v3/mc_singlesends/docs/GetSingleSend.md | 51 +++++ rest/api/v3/mc_singlesends/docs/Items.md | 14 ++ .../v3/mc_singlesends/docs/ListCategory.md | 44 +++++ .../docs/ListCategory200Response.md | 11 ++ .../v3/mc_singlesends/docs/ListSingleSend.md | 49 +++++ .../docs/ListSingleSend200Response.md | 12 ++ .../docs/ListSingleSend500Response.md | 11 ++ .../ListSingleSend500ResponseErrorsInner.md | 13 ++ rest/api/v3/mc_singlesends/docs/Metadata.md | 14 ++ .../mc_singlesends/docs/ScheduleSingleSend.md | 52 +++++ .../docs/ScheduleSingleSend201Response.md | 12 ++ .../docs/ScheduleSingleSendRequest.md | 11 ++ .../mc_singlesends/docs/SearchSingleSend.md | 50 +++++ .../mc_singlesends/docs/SinglesendRequest.md | 15 ++ .../docs/SinglesendRequestEmailConfig.md | 20 ++ .../docs/SinglesendRequestSendTo.md | 13 ++ .../mc_singlesends/docs/SinglesendResponse.md | 20 ++ .../docs/SinglesendResponseEmailConfig.md | 20 ++ .../docs/SinglesendResponseSendTo.md | 13 ++ .../docs/SinglesendResponseShort.md | 19 ++ .../docs/SinglesendResponseWarningsInner.md | 13 ++ .../mc_singlesends/docs/SinglesendSchedule.md | 12 ++ .../mc_singlesends/docs/SinglesendSearch.md | 13 ++ rest/api/v3/mc_singlesends/docs/Status.md | 12 ++ rest/api/v3/mc_singlesends/docs/Status1.md | 14 ++ rest/api/v3/mc_singlesends/docs/Status2.md | 14 ++ rest/api/v3/mc_singlesends/docs/Status3.md | 14 ++ rest/api/v3/mc_singlesends/docs/Type.md | 13 ++ .../mc_singlesends/docs/UpdateSingleSend.md | 52 +++++ .../v3/mc_singlesends/docs/WinnerCriteria.md | 14 ++ .../mc_singlesends/model_ab_test_summary.go | 32 +++ .../model_duplicate_single_send_request.go | 20 ++ rest/api/v3/mc_singlesends/model_editor.go | 23 +++ rest/api/v3/mc_singlesends/model_editor1.go | 23 +++ rest/api/v3/mc_singlesends/model_items.go | 24 +++ .../model_list_category_200_response.go | 20 ++ .../model_list_single_send_200_response.go | 20 ++ .../model_list_single_send_500_response.go | 19 ++ ...t_single_send_500_response_errors_inner.go | 21 ++ rest/api/v3/mc_singlesends/model_metadata.go | 22 +++ ...model_schedule_single_send_201_response.go | 25 +++ .../model_schedule_single_send_request.go | 24 +++ .../model_singlesend_request.go | 30 +++ .../model_singlesend_request_email_config.go | 38 ++++ .../model_singlesend_request_send_to.go | 24 +++ .../model_singlesend_response.go | 39 ++++ .../model_singlesend_response_email_config.go | 38 ++++ .../model_singlesend_response_send_to.go | 24 +++ .../model_singlesend_response_short.go | 38 ++++ ...odel_singlesend_response_warnings_inner.go | 21 ++ .../model_singlesend_schedule.go | 25 +++ .../mc_singlesends/model_singlesend_search.go | 24 +++ rest/api/v3/mc_singlesends/model_status.go | 22 +++ rest/api/v3/mc_singlesends/model_status1.go | 24 +++ rest/api/v3/mc_singlesends/model_status2.go | 24 +++ rest/api/v3/mc_singlesends/model_status3.go | 24 +++ rest/api/v3/mc_singlesends/model_type.go | 23 +++ .../mc_singlesends/model_winner_criteria.go | 24 +++ rest/api/v3/mc_stats/README.md | 88 +++++++++ .../v3/mc_stats/api_export_automation_stat.go | 79 ++++++++ .../mc_stats/api_export_single_send_stat.go | 79 ++++++++ .../v3/mc_stats/api_get_automation_stat.go | 161 +++++++++++++++ .../v3/mc_stats/api_get_single_send_stat.go | 143 ++++++++++++++ .../v3/mc_stats/api_list_automation_stat.go | 96 +++++++++ .../mc_stats/api_list_click_tracking_stat.go | 133 +++++++++++++ .../v3/mc_stats/api_list_single_send_stat.go | 96 +++++++++ .../api_list_single_send_tracking_stat.go | 133 +++++++++++++ rest/api/v3/mc_stats/api_service.go | 34 ++++ rest/api/v3/mc_stats/docs/AbPhase.md | 14 ++ rest/api/v3/mc_stats/docs/AbPhase1.md | 14 ++ rest/api/v3/mc_stats/docs/AbPhaseId.md | 13 ++ rest/api/v3/mc_stats/docs/AggregatedBy.md | 13 ++ .../docs/AutmoationsLinkStatsResponse.md | 13 ++ ...utmoationsLinkStatsResponseResultsInner.md | 14 ++ .../v3/mc_stats/docs/AutomationsResponse.md | 12 ++ .../docs/AutomationsResponseResultsInner.md | 14 ++ rest/api/v3/mc_stats/docs/ErrorResponse.md | 12 ++ .../mc_stats/docs/ErrorResponseErrorsInner.md | 13 ++ .../v3/mc_stats/docs/ExportAutomationStat.md | 49 +++++ .../v3/mc_stats/docs/ExportSingleSendStat.md | 49 +++++ .../api/v3/mc_stats/docs/GetAutomationStat.md | 59 ++++++ .../api/v3/mc_stats/docs/GetSingleSendStat.md | 58 ++++++ rest/api/v3/mc_stats/docs/Items.md | 12 ++ rest/api/v3/mc_stats/docs/Items1.md | 13 ++ rest/api/v3/mc_stats/docs/Items2.md | 13 ++ .../v3/mc_stats/docs/LinkTrackingMetadata.md | 14 ++ .../v3/mc_stats/docs/ListAutomationStat.md | 50 +++++ .../v3/mc_stats/docs/ListClickTrackingStat.md | 55 ++++++ .../v3/mc_stats/docs/ListSingleSendStat.md | 50 +++++ .../docs/ListSingleSendTrackingStat.md | 56 ++++++ rest/api/v3/mc_stats/docs/Metadata.md | 14 ++ rest/api/v3/mc_stats/docs/Metrics.md | 22 +++ .../docs/SinglesendsLinkStatsResponse.md | 13 ++ ...inglesendsLinkStatsResponseResultsInner.md | 15 ++ .../v3/mc_stats/docs/SinglesendsResponse.md | 12 ++ .../docs/SinglesendsResponseResultsInner.md | 15 ++ rest/api/v3/mc_stats/model_ab_phase.go | 24 +++ rest/api/v3/mc_stats/model_ab_phase1.go | 24 +++ rest/api/v3/mc_stats/model_ab_phase_id.go | 23 +++ rest/api/v3/mc_stats/model_aggregated_by.go | 23 +++ .../model_autmoations_link_stats_response.go | 22 +++ ...tions_link_stats_response_results_inner.go | 26 +++ .../v3/mc_stats/model_automations_response.go | 20 ++ ...odel_automations_response_results_inner.go | 25 +++ rest/api/v3/mc_stats/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ rest/api/v3/mc_stats/model_items.go | 22 +++ rest/api/v3/mc_stats/model_items1.go | 23 +++ rest/api/v3/mc_stats/model_items2.go | 23 +++ .../mc_stats/model_link_tracking_metadata.go | 26 +++ rest/api/v3/mc_stats/model_metadata.go | 26 +++ rest/api/v3/mc_stats/model_metrics.go | 30 +++ .../model_singlesends_link_stats_response.go | 22 +++ ...sends_link_stats_response_results_inner.go | 28 +++ .../v3/mc_stats/model_singlesends_response.go | 20 ++ ...odel_singlesends_response_results_inner.go | 27 +++ rest/api/v3/mc_test/README.md | 62 ++++++ .../mc_test/api_send_test_marketing_email.go | 73 +++++++ rest/api/v3/mc_test/api_service.go | 34 ++++ rest/api/v3/mc_test/docs/ErrorResponse.md | 12 ++ .../mc_test/docs/ErrorResponseErrorsInner.md | 13 ++ .../v3/mc_test/docs/SendTestMarketingEmail.md | 48 +++++ .../docs/SendTestMarketingEmailRequest.md | 17 ++ rest/api/v3/mc_test/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ ...model_send_test_marketing_email_request.go | 31 +++ rest/api/v3/partner/README.md | 61 ++++++ .../v3/partner/api_list_partner_setting.go | 79 ++++++++ rest/api/v3/partner/api_service.go | 34 ++++ .../api/v3/partner/docs/ListPartnerSetting.md | 50 +++++ .../docs/ListPartnerSetting200Response.md | 11 ++ ...istPartnerSetting200ResponseResultInner.md | 14 ++ ...model_list_partner_setting_200_response.go | 19 ++ ...rtner_setting_200_response_result_inner.go | 26 +++ rest/api/v3/recipients_data_erasure/README.md | 62 ++++++ .../api_erase_recipient_email_data.go | 74 +++++++ .../v3/recipients_data_erasure/api_service.go | 34 ++++ .../docs/EraseRecipientEmailData.md | 48 +++++ ...pientsDataErasureEraseRecipientsRequest.md | 11 ++ .../docs/RecipientsDataErasureErrorV1.md | 12 ++ .../docs/RecipientsDataErasureJobId.md | 11 ++ ...s_data_erasure_erase_recipients_request.go | 20 ++ .../model_recipients_data_erasure_error_v1.go | 22 +++ .../model_recipients_data_erasure_job_id.go | 20 ++ rest/api/v3/reverse_dns/README.md | 84 ++++++++ .../v3/reverse_dns/api_delete_reverse_dns.go | 70 +++++++ .../api/v3/reverse_dns/api_get_reverse_dns.go | 70 +++++++ .../v3/reverse_dns/api_list_reverse_dns.go | 88 +++++++++ rest/api/v3/reverse_dns/api_service.go | 34 ++++ .../v3/reverse_dns/api_set_up_reverse_dns.go | 74 +++++++ .../reverse_dns/api_validate_reverse_dns.go | 86 ++++++++ .../v3/reverse_dns/docs/DeleteReverseDns.md | 52 +++++ rest/api/v3/reverse_dns/docs/GetReverseDns.md | 52 +++++ .../api/v3/reverse_dns/docs/ListReverseDns.md | 51 +++++ rest/api/v3/reverse_dns/docs/ReverseDns.md | 20 ++ .../v3/reverse_dns/docs/ReverseDnsARecord.md | 14 ++ .../reverse_dns/docs/ReverseDnsUsersInner.md | 12 ++ .../v3/reverse_dns/docs/SetUpReverseDns.md | 49 +++++ .../docs/SetUpReverseDnsRequest.md | 13 ++ rest/api/v3/reverse_dns/docs/Valid.md | 13 ++ rest/api/v3/reverse_dns/docs/Valid1.md | 13 ++ .../v3/reverse_dns/docs/ValidateReverseDns.md | 52 +++++ .../docs/ValidateReverseDns200Response.md | 13 ++ ...eReverseDns200ResponseValidationResults.md | 11 ++ ...eDns200ResponseValidationResultsARecord.md | 12 ++ .../docs/ValidateReverseDns404Response.md | 11 ++ ...alidateReverseDns404ResponseErrorsInner.md | 11 ++ .../docs/ValidateReverseDns500Response.md | 11 ++ ...alidateReverseDns500ResponseErrorsInner.md | 11 ++ rest/api/v3/reverse_dns/model_reverse_dns.go | 37 ++++ .../reverse_dns/model_reverse_dns_a_record.go | 26 +++ .../model_reverse_dns_users_inner.go | 22 +++ .../model_set_up_reverse_dns_request.go | 24 +++ rest/api/v3/reverse_dns/model_valid.go | 23 +++ rest/api/v3/reverse_dns/model_valid1.go | 23 +++ ...model_validate_reverse_dns_200_response.go | 23 +++ ...rse_dns_200_response_validation_results.go | 19 ++ ...00_response_validation_results_a_record.go | 22 +++ ...model_validate_reverse_dns_404_response.go | 20 ++ ...e_reverse_dns_404_response_errors_inner.go | 20 ++ ...model_validate_reverse_dns_500_response.go | 20 ++ ...e_reverse_dns_500_response_errors_inner.go | 20 ++ rest/api/v3/scheduled_sends/README.md | 82 ++++++++ .../api_create_scheduled_send.go | 106 ++++++++++ .../api_delete_scheduled_send.go | 94 +++++++++ .../scheduled_sends/api_get_scheduled_send.go | 102 ++++++++++ .../api_list_scheduled_send.go | 91 +++++++++ rest/api/v3/scheduled_sends/api_service.go | 34 ++++ .../api_update_scheduled_send.go | 109 +++++++++++ .../CancelOrPauseAScheduledSendRequest.md | 12 ++ .../docs/CreateScheduledSend.md | 49 +++++ .../docs/DeleteScheduledSend.md | 52 +++++ .../v3/scheduled_sends/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ .../scheduled_sends/docs/GetScheduledSend.md | 52 +++++ .../scheduled_sends/docs/ListScheduledSend.md | 48 +++++ .../v3/scheduled_sends/docs/MailBatchId.md | 11 ++ .../docs/ScheduledSendStatus.md | 12 ++ rest/api/v3/scheduled_sends/docs/Status.md | 13 ++ rest/api/v3/scheduled_sends/docs/Status1.md | 13 ++ rest/api/v3/scheduled_sends/docs/Status2.md | 13 ++ .../docs/UpdateScheduledSend.md | 53 +++++ .../docs/UpdateScheduledSendRequest.md | 11 ++ ...ancel_or_pause_a_scheduled_send_request.go | 22 +++ .../scheduled_sends/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../v3/scheduled_sends/model_mail_batch_id.go | 19 ++ .../model_scheduled_send_status.go | 21 ++ rest/api/v3/scheduled_sends/model_status.go | 23 +++ rest/api/v3/scheduled_sends/model_status1.go | 23 +++ rest/api/v3/scheduled_sends/model_status2.go | 23 +++ .../model_update_scheduled_send_request.go | 20 ++ rest/api/v3/scopes/README.md | 71 +++++++ .../v3/scopes/api_approve_scope_request.go | 77 ++++++++ rest/api/v3/scopes/api_deny_scope_request.go | 61 ++++++ rest/api/v3/scopes/api_list_scope.go | 91 +++++++++ rest/api/v3/scopes/api_list_scope_request.go | 70 +++++++ rest/api/v3/scopes/api_service.go | 34 ++++ .../api/v3/scopes/docs/ApproveScopeRequest.md | 51 +++++ .../docs/ApproveScopeRequest200Response.md | 11 ++ rest/api/v3/scopes/docs/DenyScopeRequest.md | 51 +++++ .../docs/DenyScopeRequest404Response.md | 11 ++ .../DenyScopeRequest404ResponseErrorsInner.md | 12 ++ rest/api/v3/scopes/docs/ErrorResponse.md | 12 ++ .../scopes/docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/scopes/docs/ListScope.md | 48 +++++ .../v3/scopes/docs/ListScope200Response.md | 11 ++ .../v3/scopes/docs/ListScope401Response.md | 11 ++ .../docs/ListScope401ResponseErrorsInner.md | 12 ++ rest/api/v3/scopes/docs/ListScopeRequest.md | 49 +++++ .../docs/ListScopeRequest200ResponseInner.md | 16 ++ ...odel_approve_scope_request_200_response.go | 20 ++ .../model_deny_scope_request_404_response.go | 19 ++ ...scope_request_404_response_errors_inner.go | 20 ++ rest/api/v3/scopes/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../scopes/model_list_scope_200_response.go | 20 ++ .../scopes/model_list_scope_401_response.go | 20 ++ ...el_list_scope_401_response_errors_inner.go | 22 +++ ...l_list_scope_request_200_response_inner.go | 30 +++ rest/api/v3/seq/README.md | 71 +++++++ .../seq/api_list_engagement_quality_score.go | 70 +++++++ ...i_list_subuser_engagement_quality_score.go | 79 ++++++++ rest/api/v3/seq/api_service.go | 34 ++++ .../v3/seq/docs/ListEngagementQualityScore.md | 48 +++++ .../docs/ListSubuserEngagementQualityScore.md | 50 +++++ rest/api/v3/seq/docs/SeqError.md | 12 ++ rest/api/v3/seq/docs/SeqMetadata.md | 11 ++ rest/api/v3/seq/docs/SeqMetadataNextParams.md | 11 ++ rest/api/v3/seq/docs/SeqMetrics.md | 15 ++ rest/api/v3/seq/docs/SeqScore.md | 15 ++ rest/api/v3/seq/model_seq_error.go | 22 +++ rest/api/v3/seq/model_seq_metadata.go | 19 ++ .../v3/seq/model_seq_metadata_next_params.go | 20 ++ rest/api/v3/seq/model_seq_metrics.go | 28 +++ rest/api/v3/seq/model_seq_score.go | 27 +++ rest/api/v3/sso/README.md | 94 +++++++++ rest/api/v3/sso/api_create_sso_certificate.go | 105 ++++++++++ rest/api/v3/sso/api_create_sso_integration.go | 105 ++++++++++ rest/api/v3/sso/api_create_sso_teammate.go | 105 ++++++++++ rest/api/v3/sso/api_delete_sso_certificate.go | 101 ++++++++++ rest/api/v3/sso/api_delete_sso_integration.go | 93 +++++++++ rest/api/v3/sso/api_get_sso_certificate.go | 101 ++++++++++ rest/api/v3/sso/api_get_sso_integration.go | 112 +++++++++++ rest/api/v3/sso/api_list_sso_integration.go | 101 ++++++++++ .../api_list_sso_integration_certificate.go | 101 ++++++++++ rest/api/v3/sso/api_service.go | 34 ++++ rest/api/v3/sso/api_update_sso_certificate.go | 116 +++++++++++ rest/api/v3/sso/api_update_sso_integration.go | 126 ++++++++++++ rest/api/v3/sso/api_update_sso_teammate.go | 116 +++++++++++ rest/api/v3/sso/docs/CreateSsoCertificate.md | 48 +++++ .../sso/docs/CreateSsoCertificateRequest.md | 13 ++ rest/api/v3/sso/docs/CreateSsoIntegration.md | 48 +++++ rest/api/v3/sso/docs/CreateSsoTeammate.md | 48 +++++ rest/api/v3/sso/docs/DeleteSsoCertificate.md | 51 +++++ rest/api/v3/sso/docs/DeleteSsoIntegration.md | 51 +++++ rest/api/v3/sso/docs/GetSsoCertificate.md | 51 +++++ rest/api/v3/sso/docs/GetSsoIntegration.md | 52 +++++ rest/api/v3/sso/docs/ListSsoIntegration.md | 48 +++++ .../sso/docs/ListSsoIntegrationCertificate.md | 51 +++++ rest/api/v3/sso/docs/PatchSsoTeammates200.md | 29 +++ rest/api/v3/sso/docs/PermissionType.md | 13 ++ rest/api/v3/sso/docs/PermissionType1.md | 13 ++ rest/api/v3/sso/docs/Persona.md | 15 ++ .../sso/docs/PostPatchIntegrationRequest.md | 16 ++ rest/api/v3/sso/docs/PostSsoTeammates201.md | 18 ++ .../v3/sso/docs/PostSsoTeammatesRequest.md | 18 ++ rest/api/v3/sso/docs/SsoCertificateBody.md | 15 ++ rest/api/v3/sso/docs/SsoErrorResponseInner.md | 13 ++ rest/api/v3/sso/docs/SsoIntegration.md | 20 ++ .../sso/docs/SsoTeammatesBaseRequestProps.md | 17 ++ ...matesBaseRequestPropsSubuserAccessInner.md | 13 ++ .../sso/docs/SsoTeammatesBaseResponseProps.md | 16 ++ ...TeammatesRestrictedSubuserResponseProps.md | 12 ++ ...dSubuserResponsePropsSubuserAccessInner.md | 16 ++ rest/api/v3/sso/docs/UpdateSsoCertificate.md | 52 +++++ .../sso/docs/UpdateSsoCertificateRequest.md | 13 ++ rest/api/v3/sso/docs/UpdateSsoIntegration.md | 53 +++++ rest/api/v3/sso/docs/UpdateSsoTeammate.md | 52 +++++ rest/api/v3/sso/docs/UserType.md | 14 ++ .../model_create_sso_certificate_request.go | 24 +++ .../v3/sso/model_patch_sso_teammates200.go | 56 ++++++ rest/api/v3/sso/model_permission_type.go | 23 +++ rest/api/v3/sso/model_permission_type1.go | 23 +++ rest/api/v3/sso/model_persona.go | 25 +++ .../model_post_patch_integration_request.go | 30 +++ .../api/v3/sso/model_post_sso_teammates201.go | 34 ++++ .../sso/model_post_sso_teammates_request.go | 34 ++++ rest/api/v3/sso/model_sso_certificate_body.go | 28 +++ .../v3/sso/model_sso_error_response_inner.go | 21 ++ rest/api/v3/sso/model_sso_integration.go | 38 ++++ .../model_sso_teammates_base_request_props.go | 32 +++ ...base_request_props_subuser_access_inner.go | 24 +++ ...model_sso_teammates_base_response_props.go | 30 +++ ...mates_restricted_subuser_response_props.go | 22 +++ ...ser_response_props_subuser_access_inner.go | 30 +++ .../model_update_sso_certificate_request.go | 24 +++ rest/api/v3/sso/model_user_type.go | 24 +++ rest/api/v3/stats/README.md | 104 ++++++++++ rest/api/v3/stats/api_get_client_stat.go | 99 ++++++++++ rest/api/v3/stats/api_list_browser_stat.go | 115 +++++++++++ rest/api/v3/stats/api_list_category.go | 96 +++++++++ rest/api/v3/stats/api_list_category_stat.go | 97 +++++++++ .../v3/stats/api_list_category_stat_sum.go | 124 ++++++++++++ rest/api/v3/stats/api_list_client_stat.go | 88 +++++++++ rest/api/v3/stats/api_list_device_stat.go | 106 ++++++++++ rest/api/v3/stats/api_list_geo_stat.go | 115 +++++++++++ .../stats/api_list_mailbox_provider_stat.go | 115 +++++++++++ rest/api/v3/stats/api_list_stat.go | 106 ++++++++++ rest/api/v3/stats/api_service.go | 34 ++++ rest/api/v3/stats/docs/AdvancedStatsClicks.md | 12 ++ .../v3/stats/docs/AdvancedStatsClicksOpens.md | 14 ++ .../docs/AdvancedStatsMailboxProvider.md | 18 ++ rest/api/v3/stats/docs/AdvancedStatsOpens.md | 12 ++ rest/api/v3/stats/docs/AggregatedBy.md | 14 ++ rest/api/v3/stats/docs/AggregatedBy1.md | 14 ++ rest/api/v3/stats/docs/AggregatedBy2.md | 14 ++ rest/api/v3/stats/docs/AggregatedBy3.md | 14 ++ rest/api/v3/stats/docs/CategoryStats.md | 12 ++ .../v3/stats/docs/CategoryStatsStatsInner.md | 13 ++ .../docs/CategoryStatsStatsInnerMetrics.md | 26 +++ rest/api/v3/stats/docs/ClientType.md | 15 ++ rest/api/v3/stats/docs/Country.md | 13 ++ rest/api/v3/stats/docs/GetClientStat.md | 54 +++++ rest/api/v3/stats/docs/ListBrowserStat.md | 53 +++++ .../docs/ListBrowserStat200ResponseInner.md | 12 ++ ...stBrowserStat200ResponseInnerStatsInner.md | 13 ++ rest/api/v3/stats/docs/ListCategory.md | 51 +++++ .../docs/ListCategory200ResponseInner.md | 11 ++ .../v3/stats/docs/ListCategory400Response.md | 11 ++ .../ListCategory400ResponseErrorsInner.md | 12 ++ rest/api/v3/stats/docs/ListCategoryStat.md | 50 +++++ rest/api/v3/stats/docs/ListCategoryStatSum.md | 54 +++++ rest/api/v3/stats/docs/ListClientStat.md | 50 +++++ .../docs/ListClientStat200ResponseInner.md | 12 ++ ...istClientStat200ResponseInnerStatsInner.md | 13 ++ rest/api/v3/stats/docs/ListDeviceStat.md | 52 +++++ rest/api/v3/stats/docs/ListGeoStat.md | 53 +++++ .../stats/docs/ListGeoStat200ResponseInner.md | 12 ++ .../ListGeoStat200ResponseInnerStatsInner.md | 13 ++ .../v3/stats/docs/ListMailboxProviderStat.md | 53 +++++ ...ListMailboxProviderStat200ResponseInner.md | 12 ++ ...xProviderStat200ResponseInnerStatsInner.md | 13 ++ rest/api/v3/stats/docs/ListStat.md | 52 +++++ .../v3/stats/docs/ListStat200ResponseInner.md | 12 ++ .../ListStat200ResponseInnerStatsInner.md | 11 ++ rest/api/v3/stats/docs/SortByDirection.md | 13 ++ .../v3/stats/docs/StatsAdvancedGlobalStats.md | 26 +++ .../v3/stats/model_advanced_stats_clicks.go | 22 +++ .../model_advanced_stats_clicks_opens.go | 26 +++ .../model_advanced_stats_mailbox_provider.go | 34 ++++ .../v3/stats/model_advanced_stats_opens.go | 22 +++ rest/api/v3/stats/model_aggregated_by.go | 24 +++ rest/api/v3/stats/model_aggregated_by1.go | 24 +++ rest/api/v3/stats/model_aggregated_by2.go | 24 +++ rest/api/v3/stats/model_aggregated_by3.go | 24 +++ rest/api/v3/stats/model_category_stats.go | 21 ++ .../stats/model_category_stats_stats_inner.go | 23 +++ ...odel_category_stats_stats_inner_metrics.go | 50 +++++ rest/api/v3/stats/model_client_type.go | 25 +++ rest/api/v3/stats/model_country.go | 23 +++ ...el_list_browser_stat_200_response_inner.go | 22 +++ ...ser_stat_200_response_inner_stats_inner.go | 23 +++ .../model_list_category_200_response_inner.go | 20 ++ .../stats/model_list_category_400_response.go | 20 ++ ...list_category_400_response_errors_inner.go | 21 ++ ...del_list_client_stat_200_response_inner.go | 22 +++ ...ent_stat_200_response_inner_stats_inner.go | 23 +++ .../model_list_geo_stat_200_response_inner.go | 22 +++ ...geo_stat_200_response_inner_stats_inner.go | 23 +++ ...ailbox_provider_stat_200_response_inner.go | 22 +++ ...der_stat_200_response_inner_stats_inner.go | 23 +++ .../model_list_stat_200_response_inner.go | 22 +++ ...ist_stat_200_response_inner_stats_inner.go | 19 ++ rest/api/v3/stats/model_sort_by_direction.go | 23 +++ .../model_stats_advanced_global_stats.go | 50 +++++ rest/api/v3/subusers/README.md | 106 ++++++++++ rest/api/v3/subusers/api_create_subuser.go | 97 +++++++++ rest/api/v3/subusers/api_delete_subuser.go | 69 +++++++ .../api/v3/subusers/api_get_subuser_credit.go | 69 +++++++ rest/api/v3/subusers/api_list_monthly_stat.go | 106 ++++++++++ rest/api/v3/subusers/api_list_reputation.go | 60 ++++++ rest/api/v3/subusers/api_list_stat.go | 106 ++++++++++ rest/api/v3/subusers/api_list_stat_sum.go | 115 +++++++++++ rest/api/v3/subusers/api_list_subuser.go | 105 ++++++++++ .../subusers/api_list_subuser_monthly_stat.go | 108 ++++++++++ rest/api/v3/subusers/api_service.go | 34 ++++ rest/api/v3/subusers/api_update_subuser.go | 100 ++++++++++ .../v3/subusers/api_update_subuser_credit.go | 84 ++++++++ rest/api/v3/subusers/api_update_subuser_ip.go | 84 ++++++++ .../api_update_subuser_remaining_credit.go | 84 ++++++++ .../api_update_subuser_website_access.go | 76 ++++++++ rest/api/v3/subusers/docs/AggregatedBy.md | 14 ++ rest/api/v3/subusers/docs/CategoryStats.md | 12 ++ .../subusers/docs/CategoryStatsStatsInner.md | 13 ++ .../docs/CategoryStatsStatsInnerMetrics.md | 26 +++ rest/api/v3/subusers/docs/CreateSubuser.md | 48 +++++ .../v3/subusers/docs/CreateSubuserRequest.md | 16 ++ rest/api/v3/subusers/docs/DeleteSubuser.md | 51 +++++ rest/api/v3/subusers/docs/ErrorResponse.md | 12 ++ .../subusers/docs/ErrorResponseErrorsInner.md | 13 ++ rest/api/v3/subusers/docs/GetSubuserCredit.md | 51 +++++ rest/api/v3/subusers/docs/ListMonthlyStat.md | 52 +++++ rest/api/v3/subusers/docs/ListReputation.md | 48 +++++ .../docs/ListReputation200ResponseInner.md | 12 ++ rest/api/v3/subusers/docs/ListStat.md | 51 +++++ rest/api/v3/subusers/docs/ListStatSum.md | 53 +++++ rest/api/v3/subusers/docs/ListSubuser.md | 52 +++++ .../subusers/docs/ListSubuserMonthlyStat.md | 55 ++++++ rest/api/v3/subusers/docs/Region.md | 14 ++ rest/api/v3/subusers/docs/Region1.md | 13 ++ rest/api/v3/subusers/docs/Region2.md | 13 ++ rest/api/v3/subusers/docs/Region3.md | 13 ++ rest/api/v3/subusers/docs/ResetFrequency.md | 14 ++ rest/api/v3/subusers/docs/ResetFrequency1.md | 14 ++ rest/api/v3/subusers/docs/SortByDirection.md | 13 ++ rest/api/v3/subusers/docs/SortByDirection1.md | 13 ++ rest/api/v3/subusers/docs/SortByDirection2.md | 13 ++ rest/api/v3/subusers/docs/SortByMetric.md | 20 ++ rest/api/v3/subusers/docs/Subuser.md | 15 ++ rest/api/v3/subusers/docs/SubuserCredits.md | 15 ++ .../v3/subusers/docs/SubuserCreditsRequest.md | 13 ++ rest/api/v3/subusers/docs/SubuserPost.md | 15 ++ .../docs/SubuserPostCreditAllocation.md | 11 ++ rest/api/v3/subusers/docs/SubuserStats.md | 12 ++ .../subusers/docs/SubuserStatsStatsInner.md | 15 ++ .../docs/SubuserStatsStatsInnerMetrics.md | 26 +++ rest/api/v3/subusers/docs/Type.md | 14 ++ rest/api/v3/subusers/docs/Type1.md | 14 ++ rest/api/v3/subusers/docs/UpdateSubuser.md | 52 +++++ .../v3/subusers/docs/UpdateSubuserCredit.md | 51 +++++ rest/api/v3/subusers/docs/UpdateSubuserIp.md | 52 +++++ .../docs/UpdateSubuserIp200Response.md | 11 ++ .../docs/UpdateSubuserRemainingCredit.md | 51 +++++ .../UpdateSubuserRemainingCreditRequest.md | 11 ++ .../v3/subusers/docs/UpdateSubuserRequest.md | 11 ++ .../docs/UpdateSubuserWebsiteAccess.md | 52 +++++ .../docs/UpdateSubuserWebsiteAccessRequest.md | 11 ++ rest/api/v3/subusers/model_aggregated_by.go | 24 +++ rest/api/v3/subusers/model_category_stats.go | 21 ++ .../model_category_stats_stats_inner.go | 23 +++ ...odel_category_stats_stats_inner_metrics.go | 50 +++++ .../subusers/model_create_subuser_request.go | 30 +++ rest/api/v3/subusers/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ ...odel_list_reputation_200_response_inner.go | 22 +++ rest/api/v3/subusers/model_region.go | 24 +++ rest/api/v3/subusers/model_region1.go | 23 +++ rest/api/v3/subusers/model_region2.go | 23 +++ rest/api/v3/subusers/model_region3.go | 23 +++ rest/api/v3/subusers/model_reset_frequency.go | 24 +++ .../api/v3/subusers/model_reset_frequency1.go | 24 +++ .../v3/subusers/model_sort_by_direction.go | 23 +++ .../v3/subusers/model_sort_by_direction1.go | 23 +++ .../v3/subusers/model_sort_by_direction2.go | 23 +++ rest/api/v3/subusers/model_sort_by_metric.go | 30 +++ rest/api/v3/subusers/model_subuser.go | 28 +++ rest/api/v3/subusers/model_subuser_credits.go | 28 +++ .../subusers/model_subuser_credits_request.go | 24 +++ rest/api/v3/subusers/model_subuser_post.go | 27 +++ .../model_subuser_post_credit_allocation.go | 19 ++ rest/api/v3/subusers/model_subuser_stats.go | 22 +++ .../model_subuser_stats_stats_inner.go | 27 +++ ...model_subuser_stats_stats_inner_metrics.go | 50 +++++ rest/api/v3/subusers/model_type.go | 24 +++ rest/api/v3/subusers/model_type1.go | 24 +++ .../model_update_subuser_ip_200_response.go | 20 ++ ...update_subuser_remaining_credit_request.go | 20 ++ .../subusers/model_update_subuser_request.go | 20 ++ ...l_update_subuser_website_access_request.go | 20 ++ rest/api/v3/teammates/README.md | 89 +++++++++ .../teammates/api_delete_pending_teammate.go | 70 +++++++ rest/api/v3/teammates/api_delete_teammate.go | 70 +++++++ rest/api/v3/teammates/api_get_teammate.go | 70 +++++++ rest/api/v3/teammates/api_invite_teammate.go | 82 ++++++++ .../v3/teammates/api_list_pending_teammate.go | 59 ++++++ .../teammates/api_list_subuser_by_template.go | 122 ++++++++++++ rest/api/v3/teammates/api_list_teammate.go | 79 ++++++++ .../teammates/api_resend_teammate_invite.go | 78 ++++++++ rest/api/v3/teammates/api_service.go | 34 ++++ rest/api/v3/teammates/api_update_teammate.go | 101 ++++++++++ .../teammates/docs/DeletePendingTeammate.md | 52 +++++ rest/api/v3/teammates/docs/DeleteTeammate.md | 52 +++++ rest/api/v3/teammates/docs/GetTeammate.md | 52 +++++ .../teammates/docs/GetTeammate200Response.md | 25 +++ rest/api/v3/teammates/docs/InviteTeammate.md | 49 +++++ .../docs/InviteTeammate201Response.md | 14 ++ .../docs/InviteTeammate400Response.md | 11 ++ .../InviteTeammate400ResponseErrorsInner.md | 12 ++ .../teammates/docs/InviteTeammateRequest.md | 13 ++ .../v3/teammates/docs/ListPendingTeammate.md | 48 +++++ .../docs/ListPendingTeammate200Response.md | 11 ++ ...stPendingTeammate200ResponseResultInner.md | 15 ++ .../teammates/docs/ListSubuserByTemplate.md | 54 +++++ .../docs/ListSubuserByTemplate200Response.md | 13 ++ ...istSubuserByTemplate200ResponseMetadata.md | 11 ++ ...ByTemplate200ResponseMetadataNextParams.md | 13 ++ ...ByTemplate200ResponseSubuserAccessInner.md | 16 ++ .../docs/ListSubuserByTemplate400Response.md | 11 ++ ...SubuserByTemplate400ResponseErrorsInner.md | 12 ++ rest/api/v3/teammates/docs/ListTeammate.md | 50 +++++ .../teammates/docs/ListTeammate200Response.md | 11 ++ .../ListTeammate200ResponseResultInner.md | 24 +++ rest/api/v3/teammates/docs/PermissionType.md | 13 ++ .../v3/teammates/docs/ResendTeammateInvite.md | 52 +++++ .../docs/ResendTeammateInvite200Response.md | 14 ++ rest/api/v3/teammates/docs/UpdateTeammate.md | 53 +++++ .../docs/UpdateTeammate200Response.md | 25 +++ .../teammates/docs/UpdateTeammateRequest.md | 12 ++ rest/api/v3/teammates/docs/UserType.md | 14 ++ rest/api/v3/teammates/docs/UserType1.md | 14 ++ rest/api/v3/teammates/docs/UserType2.md | 14 ++ .../model_get_teammate_200_response.go | 48 +++++ .../model_invite_teammate_201_response.go | 26 +++ .../model_invite_teammate_400_response.go | 19 ++ ...vite_teammate_400_response_errors_inner.go | 20 ++ .../model_invite_teammate_request.go | 24 +++ ...odel_list_pending_teammate_200_response.go | 19 ++ ...ding_teammate_200_response_result_inner.go | 28 +++ ...l_list_subuser_by_template_200_response.go | 23 +++ ...user_by_template_200_response__metadata.go | 19 ++ ...late_200_response__metadata_next_params.go | 24 +++ ...plate_200_response_subuser_access_inner.go | 30 +++ ...l_list_subuser_by_template_400_response.go | 19 ++ ...r_by_template_400_response_errors_inner.go | 22 +++ .../model_list_teammate_200_response.go | 19 ++ ...list_teammate_200_response_result_inner.go | 46 +++++ .../api/v3/teammates/model_permission_type.go | 23 +++ ...del_resend_teammate_invite_200_response.go | 26 +++ .../model_update_teammate_200_response.go | 48 +++++ .../model_update_teammate_request.go | 22 +++ rest/api/v3/teammates/model_user_type.go | 24 +++ rest/api/v3/teammates/model_user_type1.go | 24 +++ rest/api/v3/teammates/model_user_type2.go | 24 +++ rest/api/v3/templates/README.md | 93 +++++++++ .../api_activate_template_version.go | 79 ++++++++ rest/api/v3/templates/api_create_template.go | 74 +++++++ .../templates/api_create_template_version.go | 85 ++++++++ rest/api/v3/templates/api_delete_template.go | 70 +++++++ .../templates/api_delete_template_version.go | 70 +++++++ .../v3/templates/api_duplicate_template.go | 85 ++++++++ rest/api/v3/templates/api_get_template.go | 70 +++++++ .../v3/templates/api_get_template_version.go | 79 ++++++++ rest/api/v3/templates/api_list_template.go | 96 +++++++++ rest/api/v3/templates/api_service.go | 34 ++++ rest/api/v3/templates/api_update_template.go | 85 ++++++++ .../templates/api_update_template_version.go | 94 +++++++++ .../templates/docs/ActivateTemplateVersion.md | 53 +++++ rest/api/v3/templates/docs/Active.md | 13 ++ rest/api/v3/templates/docs/Active1.md | 13 ++ rest/api/v3/templates/docs/CreateTemplate.md | 49 +++++ .../templates/docs/CreateTemplateRequest.md | 12 ++ .../templates/docs/CreateTemplateVersion.md | 53 +++++ rest/api/v3/templates/docs/DeleteTemplate.md | 52 +++++ .../templates/docs/DeleteTemplateVersion.md | 53 +++++ .../v3/templates/docs/DuplicateTemplate.md | 53 +++++ .../docs/DuplicateTemplateRequest.md | 11 ++ rest/api/v3/templates/docs/Editor.md | 13 ++ rest/api/v3/templates/docs/Editor1.md | 13 ++ rest/api/v3/templates/docs/Generation.md | 13 ++ rest/api/v3/templates/docs/Generation1.md | 13 ++ rest/api/v3/templates/docs/Generations.md | 14 ++ rest/api/v3/templates/docs/GetTemplate.md | 52 +++++ .../v3/templates/docs/GetTemplateVersion.md | 53 +++++ rest/api/v3/templates/docs/ListTemplate.md | 50 +++++ .../templates/docs/ListTemplate200Response.md | 12 ++ .../templates/docs/ListTemplate400Response.md | 11 ++ .../ListTemplate400ResponseErrorsInner.md | 12 ++ rest/api/v3/templates/docs/Metadata.md | 14 ++ .../templates/docs/TransactionalTemplate.md | 16 ++ .../TransactionalTemplateVersionCreate.md | 18 ++ .../TransactionalTemplateVersionOutput.md | 23 +++ .../docs/TransactionalTemplateWarning.md | 11 ++ .../TransactionalTemplatesTemplateLean.md | 15 ++ ...TransactionalTemplatesVersionOutputLean.md | 21 ++ rest/api/v3/templates/docs/UpdateTemplate.md | 53 +++++ .../templates/docs/UpdateTemplateRequest.md | 11 ++ .../templates/docs/UpdateTemplateVersion.md | 54 +++++ rest/api/v3/templates/model_active.go | 23 +++ rest/api/v3/templates/model_active1.go | 23 +++ .../model_create_template_request.go | 22 +++ .../model_duplicate_template_request.go | 20 ++ rest/api/v3/templates/model_editor.go | 23 +++ rest/api/v3/templates/model_editor1.go | 23 +++ rest/api/v3/templates/model_generation.go | 23 +++ rest/api/v3/templates/model_generation1.go | 23 +++ rest/api/v3/templates/model_generations.go | 24 +++ .../model_list_template_200_response.go | 21 ++ .../model_list_template_400_response.go | 19 ++ ...list_template_400_response_errors_inner.go | 20 ++ rest/api/v3/templates/model_metadata.go | 22 +++ .../templates/model_transactional_template.go | 29 +++ ...l_transactional_template_version_create.go | 34 ++++ ...l_transactional_template_version_output.go | 43 ++++ .../model_transactional_template_warning.go | 20 ++ ...l_transactional_templates_template_lean.go | 28 +++ ...sactional_templates_version_output_lean.go | 40 ++++ .../model_update_template_request.go | 20 ++ rest/api/v3/tracking_settings/README.md | 75 +++++++ .../api_list_click_tracking_setting.go | 59 ++++++ ..._list_google_analytics_tracking_setting.go | 59 ++++++ .../api_list_open_tracking_setting.go | 59 ++++++ .../api_list_subscription_tracking_setting.go | 59 ++++++ .../api_list_tracking_setting.go | 59 ++++++ rest/api/v3/tracking_settings/api_service.go | 34 ++++ .../api_update_click_tracking_setting.go | 74 +++++++ ...pdate_google_analytics_tracking_setting.go | 74 +++++++ .../api_update_open_tracking_setting.go | 74 +++++++ ...pi_update_subscription_tracking_setting.go | 74 +++++++ .../tracking_settings/docs/ClickTracking.md | 12 ++ .../docs/GoogleAnalyticsSettings.md | 16 ++ .../docs/ListClickTrackingSetting.md | 48 +++++ .../ListGoogleAnalyticsTrackingSetting.md | 48 +++++ .../docs/ListOpenTrackingSetting.md | 48 +++++ .../ListOpenTrackingSetting200Response.md | 11 ++ .../docs/ListSubscriptionTrackingSetting.md | 48 +++++ .../docs/ListTrackingSetting.md | 48 +++++ .../docs/ListTrackingSetting200Response.md | 11 ++ ...stTrackingSetting200ResponseResultInner.md | 14 ++ .../docs/SubscriptionTrackingSettings.md | 16 ++ .../docs/UpdateClickTrackingSetting.md | 49 +++++ .../docs/UpdateClickTrackingSettingRequest.md | 11 ++ .../UpdateGoogleAnalyticsTrackingSetting.md | 49 +++++ .../docs/UpdateOpenTrackingSetting.md | 49 +++++ .../docs/UpdateOpenTrackingSettingRequest.md | 11 ++ .../docs/UpdateSubscriptionTrackingSetting.md | 49 +++++ .../tracking_settings/model_click_tracking.go | 22 +++ .../model_google_analytics_settings.go | 30 +++ ...list_open_tracking_setting_200_response.go | 20 ++ ...odel_list_tracking_setting_200_response.go | 20 ++ ...cking_setting_200_response_result_inner.go | 26 +++ .../model_subscription_tracking_settings.go | 30 +++ ...l_update_click_tracking_setting_request.go | 20 ++ ...el_update_open_tracking_setting_request.go | 20 ++ rest/api/v3/user/README.md | 83 ++++++++ rest/api/v3/user/api_list_account.go | 59 ++++++ rest/api/v3/user/api_list_credit.go | 59 ++++++ rest/api/v3/user/api_list_email.go | 59 ++++++ rest/api/v3/user/api_list_profile.go | 59 ++++++ rest/api/v3/user/api_list_username.go | 59 ++++++ rest/api/v3/user/api_service.go | 34 ++++ rest/api/v3/user/api_update_email.go | 74 +++++++ rest/api/v3/user/api_update_password.go | 74 +++++++ rest/api/v3/user/api_update_profile.go | 82 ++++++++ rest/api/v3/user/api_update_username.go | 74 +++++++ rest/api/v3/user/docs/ErrorResponse.md | 12 ++ .../v3/user/docs/ErrorResponseErrorsInner.md | 13 ++ .../v3/user/docs/GETUserAccountResponse.md | 12 ++ .../v3/user/docs/GETUserProfileResponse.md | 21 ++ rest/api/v3/user/docs/ListAccount.md | 48 +++++ rest/api/v3/user/docs/ListCredit.md | 48 +++++ .../api/v3/user/docs/ListCredit200Response.md | 17 ++ rest/api/v3/user/docs/ListEmail.md | 48 +++++ rest/api/v3/user/docs/ListEmail200Response.md | 11 ++ rest/api/v3/user/docs/ListProfile.md | 48 +++++ rest/api/v3/user/docs/ListUsername.md | 48 +++++ .../v3/user/docs/ListUsername200Response.md | 12 ++ rest/api/v3/user/docs/Type.md | 13 ++ rest/api/v3/user/docs/UpdateEmail.md | 49 +++++ .../v3/user/docs/UpdateEmail200Response.md | 11 ++ rest/api/v3/user/docs/UpdateEmailRequest.md | 11 ++ rest/api/v3/user/docs/UpdatePassword.md | 49 +++++ .../api/v3/user/docs/UpdatePasswordRequest.md | 12 ++ rest/api/v3/user/docs/UpdateProfile.md | 49 +++++ rest/api/v3/user/docs/UpdateUsername.md | 49 +++++ .../v3/user/docs/UpdateUsername200Response.md | 11 ++ .../api/v3/user/docs/UpdateUsernameRequest.md | 11 ++ rest/api/v3/user/docs/UserProfile.md | 21 ++ rest/api/v3/user/model_error_response.go | 21 ++ .../user/model_error_response_errors_inner.go | 24 +++ .../user/model_get_user_account_response.go | 22 +++ .../user/model_get_user_profile_response.go | 40 ++++ .../v3/user/model_list_credit_200_response.go | 32 +++ .../v3/user/model_list_email_200_response.go | 20 ++ .../user/model_list_username_200_response.go | 22 +++ rest/api/v3/user/model_type.go | 23 +++ .../user/model_update_email_200_response.go | 20 ++ .../api/v3/user/model_update_email_request.go | 20 ++ .../v3/user/model_update_password_request.go | 22 +++ .../model_update_username_200_response.go | 20 ++ .../v3/user/model_update_username_request.go | 20 ++ rest/api/v3/user/model_user_profile.go | 40 ++++ rest/api/v3/verified_senders/README.md | 84 ++++++++ .../api_create_verified_sender.go | 97 +++++++++ .../api_delete_verified_sender.go | 85 ++++++++ .../api_list_verified_sender.go | 103 ++++++++++ .../api_list_verified_sender_domain.go | 73 +++++++ ...pi_list_verified_sender_steps_completed.go | 73 +++++++ .../api_resend_verified_sender.go | 93 +++++++++ rest/api/v3/verified_senders/api_service.go | 34 ++++ .../api_update_verified_sender.go | 108 ++++++++++ .../api_verify_sender_token.go | 77 ++++++++ .../docs/CreateVerifiedSender.md | 48 +++++ .../docs/CreateVerifiedSender400Response.md | 11 ++ ...ateVerifiedSender400ResponseErrorsInner.md | 13 ++ .../docs/DeleteVerifiedSender.md | 51 +++++ .../docs/DeleteVerifiedSender403Response.md | 11 ++ ...eteVerifiedSender403ResponseErrorsInner.md | 12 ++ .../docs/DeleteVerifiedSender404Response.md | 11 ++ .../v3/verified_senders/docs/ErrorResponse.md | 12 ++ .../docs/ErrorResponseErrorsInner.md | 13 ++ .../docs/ListVerifiedSender.md | 50 +++++ .../docs/ListVerifiedSender200Response.md | 11 ++ .../docs/ListVerifiedSenderDomain.md | 44 +++++ .../ListVerifiedSenderDomain200Response.md | 11 ++ ...tVerifiedSenderDomain200ResponseResults.md | 12 ++ .../docs/ListVerifiedSenderStepsCompleted.md | 44 +++++ ...VerifiedSenderStepsCompleted200Response.md | 11 ++ ...dSenderStepsCompleted200ResponseResults.md | 12 ++ .../docs/ResendVerifiedSender.md | 51 +++++ .../docs/UpdateVerifiedSender.md | 52 +++++ .../docs/VerifiedSenderRequest.md | 21 ++ .../docs/VerifiedSenderResponse.md | 24 +++ .../docs/VerifySenderToken.md | 51 +++++ ...del_create_verified_sender_400_response.go | 19 ++ ...rified_sender_400_response_errors_inner.go | 21 ++ ...del_delete_verified_sender_403_response.go | 19 ++ ...rified_sender_403_response_errors_inner.go | 20 ++ ...del_delete_verified_sender_404_response.go | 19 ++ .../verified_senders/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ ...model_list_verified_sender_200_response.go | 19 ++ ...ist_verified_sender_domain_200_response.go | 19 ++ ...fied_sender_domain_200_response_results.go | 20 ++ ...ied_sender_steps_completed_200_response.go | 19 ++ ...er_steps_completed_200_response_results.go | 20 ++ .../model_verified_sender_request.go | 29 +++ .../model_verified_sender_response.go | 32 +++ rest/api/v3/webhooks/README.md | 100 ++++++++++ .../v3/webhooks/api_create_event_webhook.go | 82 ++++++++ .../v3/webhooks/api_create_parse_setting.go | 98 ++++++++++ .../v3/webhooks/api_delete_event_webhook.go | 70 +++++++ .../v3/webhooks/api_delete_parse_setting.go | 94 +++++++++ rest/api/v3/webhooks/api_get_event_webhook.go | 88 +++++++++ rest/api/v3/webhooks/api_get_parse_setting.go | 94 +++++++++ .../webhooks/api_get_signed_event_webhook.go | 78 ++++++++ .../api/v3/webhooks/api_list_event_webhook.go | 69 +++++++ .../api/v3/webhooks/api_list_parse_setting.go | 83 ++++++++ rest/api/v3/webhooks/api_list_parse_static.go | 106 ++++++++++ rest/api/v3/webhooks/api_service.go | 34 ++++ .../api/v3/webhooks/api_test_event_webhook.go | 66 +++++++ .../v3/webhooks/api_update_event_webhook.go | 110 +++++++++++ .../v3/webhooks/api_update_parse_setting.go | 109 +++++++++++ .../api_update_signed_event_webhook.go | 93 +++++++++ rest/api/v3/webhooks/docs/AggregatedBy.md | 14 ++ .../v3/webhooks/docs/CreateEventWebhook.md | 49 +++++ .../docs/CreateEventWebhook400Response.md | 11 ++ ...reateEventWebhook400ResponseErrorsInner.md | 13 ++ .../v3/webhooks/docs/CreateParseSetting.md | 49 +++++ .../v3/webhooks/docs/DeleteEventWebhook.md | 52 +++++ .../v3/webhooks/docs/DeleteParseSetting.md | 52 +++++ rest/api/v3/webhooks/docs/ErrorResponse.md | 12 ++ .../webhooks/docs/ErrorResponseErrorsInner.md | 13 ++ .../webhooks/docs/EventWebhookAllResponse.md | 12 ++ .../docs/EventWebhookBaseResponseProps.md | 26 +++ .../docs/EventWebhookDateResponseProps.md | 12 ++ .../docs/EventWebhookNoDatesResponse.md | 29 +++ .../docs/EventWebhookOauthResponseProps.md | 12 ++ .../v3/webhooks/docs/EventWebhookRequest.md | 27 +++ .../docs/EventWebhookSignedResponse.md | 31 +++ .../docs/EventWebhookSignedResponseProp.md | 11 ++ .../webhooks/docs/EventWebhookTestRequest.md | 15 ++ .../docs/EventWebhookUnsignedResponse.md | 30 +++ rest/api/v3/webhooks/docs/GetEventWebhook.md | 53 +++++ rest/api/v3/webhooks/docs/GetParseSetting.md | 52 +++++ .../v3/webhooks/docs/GetSignedEventWebhook.md | 52 +++++ .../docs/GetSignedEventWebhook200Response.md | 12 ++ .../docs/GetSignedEventWebhook404Response.md | 11 ++ ...ignedEventWebhook404ResponseErrorsInner.md | 11 ++ rest/api/v3/webhooks/docs/ListEventWebhook.md | 49 +++++ rest/api/v3/webhooks/docs/ListParseSetting.md | 48 +++++ .../docs/ListParseSetting200Response.md | 11 ++ rest/api/v3/webhooks/docs/ListParseStatic.md | 52 +++++ .../docs/ListParseStatic200ResponseInner.md | 12 ++ ...stParseStatic200ResponseInnerStatsInner.md | 11 ++ ...Static200ResponseInnerStatsInnerMetrics.md | 11 ++ rest/api/v3/webhooks/docs/ParseSetting.md | 14 ++ rest/api/v3/webhooks/docs/TestEventWebhook.md | 49 +++++ .../v3/webhooks/docs/UpdateEventWebhook.md | 54 +++++ .../v3/webhooks/docs/UpdateParseSetting.md | 53 +++++ .../webhooks/docs/UpdateSignedEventWebhook.md | 53 +++++ .../docs/UpdateSignedEventWebhookRequest.md | 11 ++ rest/api/v3/webhooks/model_aggregated_by.go | 24 +++ ...model_create_event_webhook_400_response.go | 19 ++ ...event_webhook_400_response_errors_inner.go | 24 +++ rest/api/v3/webhooks/model_error_response.go | 21 ++ .../model_error_response_errors_inner.go | 24 +++ .../model_event_webhook_all_response.go | 22 +++ ...model_event_webhook_base_response_props.go | 50 +++++ ...model_event_webhook_date_response_props.go | 26 +++ .../model_event_webhook_no_dates_response.go | 56 ++++++ ...odel_event_webhook_oauth_response_props.go | 22 +++ .../webhooks/model_event_webhook_request.go | 52 +++++ .../model_event_webhook_signed_response.go | 64 ++++++ ...odel_event_webhook_signed_response_prop.go | 20 ++ .../model_event_webhook_test_request.go | 28 +++ .../model_event_webhook_unsigned_response.go | 62 ++++++ ...l_get_signed_event_webhook_200_response.go | 22 +++ ...l_get_signed_event_webhook_404_response.go | 19 ++ ...event_webhook_404_response_errors_inner.go | 20 ++ .../model_list_parse_setting_200_response.go | 20 ++ ...el_list_parse_static_200_response_inner.go | 22 +++ ...e_static_200_response_inner_stats_inner.go | 19 ++ ..._200_response_inner_stats_inner_metrics.go | 20 ++ rest/api/v3/webhooks/model_parse_setting.go | 26 +++ ...del_update_signed_event_webhook_request.go | 20 ++ sendgrid.go | 15 +- 2156 files changed, 76487 insertions(+), 6 deletions(-) create mode 100644 rest/api/v3/account_provisioning/README.md create mode 100644 rest/api/v3/account_provisioning/api_authenticate_account.go create mode 100644 rest/api/v3/account_provisioning/api_create_account.go create mode 100644 rest/api/v3/account_provisioning/api_delete_account.go create mode 100644 rest/api/v3/account_provisioning/api_get_account_state.go create mode 100644 rest/api/v3/account_provisioning/api_list_account.go create mode 100644 rest/api/v3/account_provisioning/api_list_account_offering.go create mode 100644 rest/api/v3/account_provisioning/api_list_offering.go create mode 100644 rest/api/v3/account_provisioning/api_service.go create mode 100644 rest/api/v3/account_provisioning/api_update_account_offering.go create mode 100644 rest/api/v3/account_provisioning/api_update_account_state.go create mode 100644 rest/api/v3/account_provisioning/docs/AccountList.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningAccount.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningAccountId.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningCatalog.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingList.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingV1.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningPagination.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningProfile.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningStateRead.md create mode 100644 rest/api/v3/account_provisioning/docs/AccountProvisioningStateWrite.md create mode 100644 rest/api/v3/account_provisioning/docs/AuthenticateAccount.md create mode 100644 rest/api/v3/account_provisioning/docs/CatalogEntry.md create mode 100644 rest/api/v3/account_provisioning/docs/CatalogEntryEntitlements.md create mode 100644 rest/api/v3/account_provisioning/docs/CreateAccount.md create mode 100644 rest/api/v3/account_provisioning/docs/CreateAccountParams.md create mode 100644 rest/api/v3/account_provisioning/docs/DeleteAccount.md create mode 100644 rest/api/v3/account_provisioning/docs/ErrorResponse.md create mode 100644 rest/api/v3/account_provisioning/docs/GetAccountState.md create mode 100644 rest/api/v3/account_provisioning/docs/ListAccount.md create mode 100644 rest/api/v3/account_provisioning/docs/ListAccountOffering.md create mode 100644 rest/api/v3/account_provisioning/docs/ListOffering.md create mode 100644 rest/api/v3/account_provisioning/docs/OfferingsToAdd.md create mode 100644 rest/api/v3/account_provisioning/docs/State.md create mode 100644 rest/api/v3/account_provisioning/docs/State1.md create mode 100644 rest/api/v3/account_provisioning/docs/Type.md create mode 100644 rest/api/v3/account_provisioning/docs/UpdateAccountOffering.md create mode 100644 rest/api/v3/account_provisioning/docs/UpdateAccountState.md create mode 100644 rest/api/v3/account_provisioning/model_account_list.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_account.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_account_id.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_catalog.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_offering_list.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_offering_v1.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_pagination.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_profile.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_state_read.go create mode 100644 rest/api/v3/account_provisioning/model_account_provisioning_state_write.go create mode 100644 rest/api/v3/account_provisioning/model_catalog_entry.go create mode 100644 rest/api/v3/account_provisioning/model_catalog_entry_entitlements.go create mode 100644 rest/api/v3/account_provisioning/model_create_account_params.go create mode 100644 rest/api/v3/account_provisioning/model_error_response.go create mode 100644 rest/api/v3/account_provisioning/model_offerings_to_add.go create mode 100644 rest/api/v3/account_provisioning/model_state.go create mode 100644 rest/api/v3/account_provisioning/model_state1.go create mode 100644 rest/api/v3/account_provisioning/model_type.go create mode 100644 rest/api/v3/alerts/README.md create mode 100644 rest/api/v3/alerts/api_create_alert.go create mode 100644 rest/api/v3/alerts/api_delete_alert.go create mode 100644 rest/api/v3/alerts/api_get_alert.go create mode 100644 rest/api/v3/alerts/api_list_alert.go create mode 100644 rest/api/v3/alerts/api_service.go create mode 100644 rest/api/v3/alerts/api_update_alert.go create mode 100644 rest/api/v3/alerts/docs/CreateAlert.md create mode 100644 rest/api/v3/alerts/docs/CreateAlert201Response.md create mode 100644 rest/api/v3/alerts/docs/CreateAlertRequest.md create mode 100644 rest/api/v3/alerts/docs/DeleteAlert.md create mode 100644 rest/api/v3/alerts/docs/ErrorResponse.md create mode 100644 rest/api/v3/alerts/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/alerts/docs/GetAlert.md create mode 100644 rest/api/v3/alerts/docs/GetAlert200Response.md create mode 100644 rest/api/v3/alerts/docs/ListAlert.md create mode 100644 rest/api/v3/alerts/docs/ListAlert200ResponseInner.md create mode 100644 rest/api/v3/alerts/docs/Type.md create mode 100644 rest/api/v3/alerts/docs/Type1.md create mode 100644 rest/api/v3/alerts/docs/Type2.md create mode 100644 rest/api/v3/alerts/docs/Type3.md create mode 100644 rest/api/v3/alerts/docs/UpdateAlert.md create mode 100644 rest/api/v3/alerts/docs/UpdateAlert200Response.md create mode 100644 rest/api/v3/alerts/docs/UpdateAlertRequest.md create mode 100644 rest/api/v3/alerts/model_create_alert_201_response.go create mode 100644 rest/api/v3/alerts/model_create_alert_request.go create mode 100644 rest/api/v3/alerts/model_error_response.go create mode 100644 rest/api/v3/alerts/model_error_response_errors_inner.go create mode 100644 rest/api/v3/alerts/model_get_alert_200_response.go create mode 100644 rest/api/v3/alerts/model_list_alert_200_response_inner.go create mode 100644 rest/api/v3/alerts/model_type.go create mode 100644 rest/api/v3/alerts/model_type1.go create mode 100644 rest/api/v3/alerts/model_type2.go create mode 100644 rest/api/v3/alerts/model_type3.go create mode 100644 rest/api/v3/alerts/model_update_alert_200_response.go create mode 100644 rest/api/v3/alerts/model_update_alert_request.go create mode 100644 rest/api/v3/api_keys/README.md create mode 100644 rest/api/v3/api_keys/api_create_api_key.go create mode 100644 rest/api/v3/api_keys/api_delete_api_key.go create mode 100644 rest/api/v3/api_keys/api_get_api_key.go create mode 100644 rest/api/v3/api_keys/api_list_api_key.go create mode 100644 rest/api/v3/api_keys/api_service.go create mode 100644 rest/api/v3/api_keys/api_update_api_key.go create mode 100644 rest/api/v3/api_keys/api_update_api_key_name.go create mode 100644 rest/api/v3/api_keys/docs/ApiKeyResponse.md create mode 100644 rest/api/v3/api_keys/docs/ApiKeyScopesResponse.md create mode 100644 rest/api/v3/api_keys/docs/CreateApiKey.md create mode 100644 rest/api/v3/api_keys/docs/CreateApiKey201Response.md create mode 100644 rest/api/v3/api_keys/docs/CreateApiKeyRequest.md create mode 100644 rest/api/v3/api_keys/docs/DeleteApiKey.md create mode 100644 rest/api/v3/api_keys/docs/ErrorResponse.md create mode 100644 rest/api/v3/api_keys/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/api_keys/docs/GetApiKey.md create mode 100644 rest/api/v3/api_keys/docs/GetApiKey200Response.md create mode 100644 rest/api/v3/api_keys/docs/ListApiKey.md create mode 100644 rest/api/v3/api_keys/docs/ListApiKey200Response.md create mode 100644 rest/api/v3/api_keys/docs/UpdateApiKey.md create mode 100644 rest/api/v3/api_keys/docs/UpdateApiKeyName.md create mode 100644 rest/api/v3/api_keys/docs/UpdateApiKeyNameRequest.md create mode 100644 rest/api/v3/api_keys/docs/UpdateApiKeyRequest.md create mode 100644 rest/api/v3/api_keys/model_api_key_response.go create mode 100644 rest/api/v3/api_keys/model_api_key_scopes_response.go create mode 100644 rest/api/v3/api_keys/model_create_api_key_201_response.go create mode 100644 rest/api/v3/api_keys/model_create_api_key_request.go create mode 100644 rest/api/v3/api_keys/model_error_response.go create mode 100644 rest/api/v3/api_keys/model_error_response_errors_inner.go create mode 100644 rest/api/v3/api_keys/model_get_api_key_200_response.go create mode 100644 rest/api/v3/api_keys/model_list_api_key_200_response.go create mode 100644 rest/api/v3/api_keys/model_update_api_key_name_request.go create mode 100644 rest/api/v3/api_keys/model_update_api_key_request.go create mode 100644 rest/api/v3/domain_authentication/README.md create mode 100644 rest/api/v3/domain_authentication/api_add_ip_to_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/api_associate_subuser_with_domain.go create mode 100644 rest/api/v3/domain_authentication/api_associate_subuser_with_domain_multiple.go create mode 100644 rest/api/v3/domain_authentication/api_authenticate_domain.go create mode 100644 rest/api/v3/domain_authentication/api_delete_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/api_delete_ip_from_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/api_disassociate_authenticated_domain_from_user.go create mode 100644 rest/api/v3/domain_authentication/api_disassociate_subuser_from_domain.go create mode 100644 rest/api/v3/domain_authentication/api_email_dns_record.go create mode 100644 rest/api/v3/domain_authentication/api_get_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/api_list_all_authenticated_domain_with_user.go create mode 100644 rest/api/v3/domain_authentication/api_list_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/api_list_authenticated_domain_with_user.go create mode 100644 rest/api/v3/domain_authentication/api_list_default_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/api_service.go create mode 100644 rest/api/v3/domain_authentication/api_update_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/api_validate_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomainRequest.md create mode 100644 rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainMultiple.md create mode 100644 rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainRequest.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticateDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticateDomainRequest.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpf.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDns.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDkim.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDomainSpf.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsMailServer.md create mode 100644 rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsSubdomainSpf.md create mode 100644 rest/api/v3/domain_authentication/docs/DeleteAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/DeleteIpFromAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/DisassociateAuthenticatedDomainFromUser.md create mode 100644 rest/api/v3/domain_authentication/docs/DisassociateSubuserFromDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/EmailDnsRecord.md create mode 100644 rest/api/v3/domain_authentication/docs/EmailDnsRecord400Response.md create mode 100644 rest/api/v3/domain_authentication/docs/EmailDnsRecord400ResponseErrors.md create mode 100644 rest/api/v3/domain_authentication/docs/EmailDnsRecordRequest.md create mode 100644 rest/api/v3/domain_authentication/docs/GetAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser.md create mode 100644 rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInner.md create mode 100644 rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDns.md create mode 100644 rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1.md create mode 100644 rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname.md create mode 100644 rest/api/v3/domain_authentication/docs/ListAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/ListAuthenticatedDomainWithUser.md create mode 100644 rest/api/v3/domain_authentication/docs/ListDefaultAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomainRequest.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200Response.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResults.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsDkim1.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsMailCname.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsSpf.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500Response.md create mode 100644 rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500ResponseErrorsInner.md create mode 100644 rest/api/v3/domain_authentication/model_add_ip_to_authenticated_domain_request.go create mode 100644 rest/api/v3/domain_authentication/model_associate_subuser_with_domain_request.go create mode 100644 rest/api/v3/domain_authentication/model_authenticate_domain_request.go create mode 100644 rest/api/v3/domain_authentication/model_authenticated_domain.go create mode 100644 rest/api/v3/domain_authentication/model_authenticated_domain_spf.go create mode 100644 rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns.go create mode 100644 rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_dkim.go create mode 100644 rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_domain_spf.go create mode 100644 rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_mail_server.go create mode 100644 rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_subdomain_spf.go create mode 100644 rest/api/v3/domain_authentication/model_email_dns_record_400_response.go create mode 100644 rest/api/v3/domain_authentication/model_email_dns_record_400_response_errors.go create mode 100644 rest/api/v3/domain_authentication/model_email_dns_record_request.go create mode 100644 rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner.go create mode 100644 rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns.go create mode 100644 rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_dkim1.go create mode 100644 rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_mail_cname.go create mode 100644 rest/api/v3/domain_authentication/model_update_authenticated_domain_request.go create mode 100644 rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response.go create mode 100644 rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results.go create mode 100644 rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_dkim1.go create mode 100644 rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_mail_cname.go create mode 100644 rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_spf.go create mode 100644 rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response.go create mode 100644 rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response_errors_inner.go create mode 100644 rest/api/v3/email_activity/README.md create mode 100644 rest/api/v3/email_activity/api_download_csv.go create mode 100644 rest/api/v3/email_activity/api_get_message.go create mode 100644 rest/api/v3/email_activity/api_list_message.go create mode 100644 rest/api/v3/email_activity/api_request_csv.go create mode 100644 rest/api/v3/email_activity/api_service.go create mode 100644 rest/api/v3/email_activity/docs/AbbvMessage.md create mode 100644 rest/api/v3/email_activity/docs/BounceType.md create mode 100644 rest/api/v3/email_activity/docs/BounceType1.md create mode 100644 rest/api/v3/email_activity/docs/DownloadCsv.md create mode 100644 rest/api/v3/email_activity/docs/DownloadCsv200Response.md create mode 100644 rest/api/v3/email_activity/docs/EmailActivityResponseBaseProps.md create mode 100644 rest/api/v3/email_activity/docs/Event.md create mode 100644 rest/api/v3/email_activity/docs/EventName.md create mode 100644 rest/api/v3/email_activity/docs/EventName1.md create mode 100644 rest/api/v3/email_activity/docs/GetMessage.md create mode 100644 rest/api/v3/email_activity/docs/GetMessage404Response.md create mode 100644 rest/api/v3/email_activity/docs/GetMessage404ResponseErrorsInner.md create mode 100644 rest/api/v3/email_activity/docs/ListMessage.md create mode 100644 rest/api/v3/email_activity/docs/ListMessage200Response.md create mode 100644 rest/api/v3/email_activity/docs/ListMessage400Response.md create mode 100644 rest/api/v3/email_activity/docs/ListMessage400ResponseErrorsInner.md create mode 100644 rest/api/v3/email_activity/docs/ListMessage429Response.md create mode 100644 rest/api/v3/email_activity/docs/ListMessage429ResponseErrorsInner.md create mode 100644 rest/api/v3/email_activity/docs/Message.md create mode 100644 rest/api/v3/email_activity/docs/OutboundIpType.md create mode 100644 rest/api/v3/email_activity/docs/OutboundIpType1.md create mode 100644 rest/api/v3/email_activity/docs/RequestCsv.md create mode 100644 rest/api/v3/email_activity/docs/RequestCsv202Response.md create mode 100644 rest/api/v3/email_activity/docs/Status.md create mode 100644 rest/api/v3/email_activity/docs/Status1.md create mode 100644 rest/api/v3/email_activity/docs/Status2.md create mode 100644 rest/api/v3/email_activity/docs/Status3.md create mode 100644 rest/api/v3/email_activity/model_abbv__message.go create mode 100644 rest/api/v3/email_activity/model_bounce_type.go create mode 100644 rest/api/v3/email_activity/model_bounce_type1.go create mode 100644 rest/api/v3/email_activity/model_download_csv_200_response.go create mode 100644 rest/api/v3/email_activity/model_email_activity_response_base_props.go create mode 100644 rest/api/v3/email_activity/model_event.go create mode 100644 rest/api/v3/email_activity/model_event_name.go create mode 100644 rest/api/v3/email_activity/model_event_name1.go create mode 100644 rest/api/v3/email_activity/model_get_message_404_response.go create mode 100644 rest/api/v3/email_activity/model_get_message_404_response_errors_inner.go create mode 100644 rest/api/v3/email_activity/model_list_message_200_response.go create mode 100644 rest/api/v3/email_activity/model_list_message_400_response.go create mode 100644 rest/api/v3/email_activity/model_list_message_400_response_errors_inner.go create mode 100644 rest/api/v3/email_activity/model_list_message_429_response.go create mode 100644 rest/api/v3/email_activity/model_list_message_429_response_errors_inner.go create mode 100644 rest/api/v3/email_activity/model_message.go create mode 100644 rest/api/v3/email_activity/model_outbound_ip_type.go create mode 100644 rest/api/v3/email_activity/model_outbound_ip_type1.go create mode 100644 rest/api/v3/email_activity/model_request_csv_202_response.go create mode 100644 rest/api/v3/email_activity/model_status.go create mode 100644 rest/api/v3/email_activity/model_status1.go create mode 100644 rest/api/v3/email_activity/model_status2.go create mode 100644 rest/api/v3/email_activity/model_status3.go create mode 100644 rest/api/v3/email_validation/README.md create mode 100644 rest/api/v3/email_validation/api_get_email_job_for_verification.go create mode 100644 rest/api/v3/email_validation/api_get_validations_email_jobs.go create mode 100644 rest/api/v3/email_validation/api_list_email_job_for_verification.go create mode 100644 rest/api/v3/email_validation/api_service.go create mode 100644 rest/api/v3/email_validation/api_validate_email.go create mode 100644 rest/api/v3/email_validation/docs/ErrorResponse.md create mode 100644 rest/api/v3/email_validation/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/email_validation/docs/FileType.md create mode 100644 rest/api/v3/email_validation/docs/GetEmailJobForVerification.md create mode 100644 rest/api/v3/email_validation/docs/GetValidationsEmailJobs.md create mode 100644 rest/api/v3/email_validation/docs/GetValidationsEmailJobs200Response.md create mode 100644 rest/api/v3/email_validation/docs/GetValidationsEmailJobs200ResponseResultInner.md create mode 100644 rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200Response.md create mode 100644 rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResult.md create mode 100644 rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResultErrorsInner.md create mode 100644 rest/api/v3/email_validation/docs/ListEmailJobForVerification.md create mode 100644 rest/api/v3/email_validation/docs/ListEmailJobForVerificationRequest.md create mode 100644 rest/api/v3/email_validation/docs/PutValidationsEmailJobs200Response.md create mode 100644 rest/api/v3/email_validation/docs/PutValidationsEmailJobs200ResponseUploadHeadersInner.md create mode 100644 rest/api/v3/email_validation/docs/Status.md create mode 100644 rest/api/v3/email_validation/docs/Status1.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmail.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmail200Response.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmail200ResponseResult.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecks.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksAdditional.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksDomain.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksLocalPart.md create mode 100644 rest/api/v3/email_validation/docs/ValidateEmailRequest.md create mode 100644 rest/api/v3/email_validation/docs/Verdict.md create mode 100644 rest/api/v3/email_validation/model_error_response.go create mode 100644 rest/api/v3/email_validation/model_error_response_errors_inner.go create mode 100644 rest/api/v3/email_validation/model_file_type.go create mode 100644 rest/api/v3/email_validation/model_get_validations_email_jobs200_response.go create mode 100644 rest/api/v3/email_validation/model_get_validations_email_jobs200_response_result_inner.go create mode 100644 rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response.go create mode 100644 rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result.go create mode 100644 rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result_errors_inner.go create mode 100644 rest/api/v3/email_validation/model_list_email_job_for_verification_request.go create mode 100644 rest/api/v3/email_validation/model_put_validations_email_jobs200_response.go create mode 100644 rest/api/v3/email_validation/model_put_validations_email_jobs200_response_upload_headers_inner.go create mode 100644 rest/api/v3/email_validation/model_status.go create mode 100644 rest/api/v3/email_validation/model_status1.go create mode 100644 rest/api/v3/email_validation/model_validate_email_200_response.go create mode 100644 rest/api/v3/email_validation/model_validate_email_200_response_result.go create mode 100644 rest/api/v3/email_validation/model_validate_email_200_response_result_checks.go create mode 100644 rest/api/v3/email_validation/model_validate_email_200_response_result_checks_additional.go create mode 100644 rest/api/v3/email_validation/model_validate_email_200_response_result_checks_domain.go create mode 100644 rest/api/v3/email_validation/model_validate_email_200_response_result_checks_local_part.go create mode 100644 rest/api/v3/email_validation/model_validate_email_request.go create mode 100644 rest/api/v3/email_validation/model_verdict.go create mode 100644 rest/api/v3/enforced_tls/README.md create mode 100644 rest/api/v3/enforced_tls/api_list_enforced_tls_setting.go create mode 100644 rest/api/v3/enforced_tls/api_service.go create mode 100644 rest/api/v3/enforced_tls/api_update_enforced_tls_setting.go create mode 100644 rest/api/v3/enforced_tls/docs/EnforcedTlsRequestResponse.md create mode 100644 rest/api/v3/enforced_tls/docs/ErrorResponse.md create mode 100644 rest/api/v3/enforced_tls/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/enforced_tls/docs/ListEnforcedTlsSetting.md create mode 100644 rest/api/v3/enforced_tls/docs/UpdateEnforcedTlsSetting.md create mode 100644 rest/api/v3/enforced_tls/docs/Version.md create mode 100644 rest/api/v3/enforced_tls/model_enforced_tls_request_response.go create mode 100644 rest/api/v3/enforced_tls/model_error_response.go create mode 100644 rest/api/v3/enforced_tls/model_error_response_errors_inner.go create mode 100644 rest/api/v3/enforced_tls/model_version.go create mode 100644 rest/api/v3/integrations/README.md create mode 100644 rest/api/v3/integrations/api_add_integration.go create mode 100644 rest/api/v3/integrations/api_delete_integration.go create mode 100644 rest/api/v3/integrations/api_find_integration_by_id.go create mode 100644 rest/api/v3/integrations/api_get_integrations_by_user.go create mode 100644 rest/api/v3/integrations/api_service.go create mode 100644 rest/api/v3/integrations/api_update_integration.go create mode 100644 rest/api/v3/integrations/docs/AddIntegration.md create mode 100644 rest/api/v3/integrations/docs/AddIntegration400Response.md create mode 100644 rest/api/v3/integrations/docs/DeleteIntegration.md create mode 100644 rest/api/v3/integrations/docs/DeleteIntegration400Response.md create mode 100644 rest/api/v3/integrations/docs/DeleteIntegration404Response.md create mode 100644 rest/api/v3/integrations/docs/Destination.md create mode 100644 rest/api/v3/integrations/docs/Destination1.md create mode 100644 rest/api/v3/integrations/docs/Destination2.md create mode 100644 rest/api/v3/integrations/docs/Destination3.md create mode 100644 rest/api/v3/integrations/docs/DestinationRegion.md create mode 100644 rest/api/v3/integrations/docs/DestinationRegion1.md create mode 100644 rest/api/v3/integrations/docs/DestinationRegion2.md create mode 100644 rest/api/v3/integrations/docs/FindIntegrationById.md create mode 100644 rest/api/v3/integrations/docs/Forbidden.md create mode 100644 rest/api/v3/integrations/docs/GetIntegrationsByUser.md create mode 100644 rest/api/v3/integrations/docs/GetIntegrationsByUser200Response.md create mode 100644 rest/api/v3/integrations/docs/GetIntegrationsByUser403Response.md create mode 100644 rest/api/v3/integrations/docs/GetIntegrationsByUser500Response.md create mode 100644 rest/api/v3/integrations/docs/Id.md create mode 100644 rest/api/v3/integrations/docs/Integration.md create mode 100644 rest/api/v3/integrations/docs/IntegrationFilters.md create mode 100644 rest/api/v3/integrations/docs/IntegrationInput.md create mode 100644 rest/api/v3/integrations/docs/IntegrationInputFilters.md create mode 100644 rest/api/v3/integrations/docs/IntegrationInputProperties.md create mode 100644 rest/api/v3/integrations/docs/IntegrationNotFound.md create mode 100644 rest/api/v3/integrations/docs/IntegrationPatch.md create mode 100644 rest/api/v3/integrations/docs/IntegrationPatchFilters.md create mode 100644 rest/api/v3/integrations/docs/IntegrationPatchProperties.md create mode 100644 rest/api/v3/integrations/docs/IntegrationProperties.md create mode 100644 rest/api/v3/integrations/docs/InternalError.md create mode 100644 rest/api/v3/integrations/docs/InvalidDeleteRequest.md create mode 100644 rest/api/v3/integrations/docs/InvalidRequest.md create mode 100644 rest/api/v3/integrations/docs/Items.md create mode 100644 rest/api/v3/integrations/docs/Items1.md create mode 100644 rest/api/v3/integrations/docs/Items2.md create mode 100644 rest/api/v3/integrations/docs/UpdateIntegration.md create mode 100644 rest/api/v3/integrations/model_add_integration_400_response.go create mode 100644 rest/api/v3/integrations/model_delete_integration_400_response.go create mode 100644 rest/api/v3/integrations/model_delete_integration_404_response.go create mode 100644 rest/api/v3/integrations/model_destination.go create mode 100644 rest/api/v3/integrations/model_destination1.go create mode 100644 rest/api/v3/integrations/model_destination2.go create mode 100644 rest/api/v3/integrations/model_destination3.go create mode 100644 rest/api/v3/integrations/model_destination_region.go create mode 100644 rest/api/v3/integrations/model_destination_region1.go create mode 100644 rest/api/v3/integrations/model_destination_region2.go create mode 100644 rest/api/v3/integrations/model_forbidden.go create mode 100644 rest/api/v3/integrations/model_get_integrations_by_user_200_response.go create mode 100644 rest/api/v3/integrations/model_get_integrations_by_user_403_response.go create mode 100644 rest/api/v3/integrations/model_get_integrations_by_user_500_response.go create mode 100644 rest/api/v3/integrations/model_id.go create mode 100644 rest/api/v3/integrations/model_integration.go create mode 100644 rest/api/v3/integrations/model_integration_filters.go create mode 100644 rest/api/v3/integrations/model_integration_input.go create mode 100644 rest/api/v3/integrations/model_integration_input_filters.go create mode 100644 rest/api/v3/integrations/model_integration_input_properties.go create mode 100644 rest/api/v3/integrations/model_integration_not_found.go create mode 100644 rest/api/v3/integrations/model_integration_patch.go create mode 100644 rest/api/v3/integrations/model_integration_patch_filters.go create mode 100644 rest/api/v3/integrations/model_integration_patch_properties.go create mode 100644 rest/api/v3/integrations/model_integration_properties.go create mode 100644 rest/api/v3/integrations/model_internal_error.go create mode 100644 rest/api/v3/integrations/model_invalid_delete_request.go create mode 100644 rest/api/v3/integrations/model_invalid_request.go create mode 100644 rest/api/v3/integrations/model_items.go create mode 100644 rest/api/v3/integrations/model_items1.go create mode 100644 rest/api/v3/integrations/model_items2.go create mode 100644 rest/api/v3/ip_access_management/README.md create mode 100644 rest/api/v3/ip_access_management/api_add_ip_to_allow_list.go create mode 100644 rest/api/v3/ip_access_management/api_delete_allowed_ip.go create mode 100644 rest/api/v3/ip_access_management/api_delete_allowed_ips.go create mode 100644 rest/api/v3/ip_access_management/api_get_allowed_ip.go create mode 100644 rest/api/v3/ip_access_management/api_list_access_activity.go create mode 100644 rest/api/v3/ip_access_management/api_list_allowed_ip.go create mode 100644 rest/api/v3/ip_access_management/api_service.go create mode 100644 rest/api/v3/ip_access_management/docs/AddIpToAllowList.md create mode 100644 rest/api/v3/ip_access_management/docs/AddIpToAllowListRequest.md create mode 100644 rest/api/v3/ip_access_management/docs/AddIpToAllowListRequestIpsInner.md create mode 100644 rest/api/v3/ip_access_management/docs/DeleteAllowedIp.md create mode 100644 rest/api/v3/ip_access_management/docs/DeleteAllowedIps.md create mode 100644 rest/api/v3/ip_access_management/docs/DeleteAllowedIpsRequest.md create mode 100644 rest/api/v3/ip_access_management/docs/ErrorResponse.md create mode 100644 rest/api/v3/ip_access_management/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/ip_access_management/docs/GetAllowedIp.md create mode 100644 rest/api/v3/ip_access_management/docs/IpAccessManagement2xx.md create mode 100644 rest/api/v3/ip_access_management/docs/IpAccessManagement2xxResultInner.md create mode 100644 rest/api/v3/ip_access_management/docs/ListAccessActivity.md create mode 100644 rest/api/v3/ip_access_management/docs/ListAccessActivity200Response.md create mode 100644 rest/api/v3/ip_access_management/docs/ListAccessActivity200ResponseResultInner.md create mode 100644 rest/api/v3/ip_access_management/docs/ListAllowedIp.md create mode 100644 rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request.go create mode 100644 rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request_ips_inner.go create mode 100644 rest/api/v3/ip_access_management/model_delete_allowed_ips_request.go create mode 100644 rest/api/v3/ip_access_management/model_error_response.go create mode 100644 rest/api/v3/ip_access_management/model_error_response_errors_inner.go create mode 100644 rest/api/v3/ip_access_management/model_ip_access_management2xx.go create mode 100644 rest/api/v3/ip_access_management/model_ip_access_management2xx_result_inner.go create mode 100644 rest/api/v3/ip_access_management/model_list_access_activity_200_response.go create mode 100644 rest/api/v3/ip_access_management/model_list_access_activity_200_response_result_inner.go create mode 100644 rest/api/v3/ip_address_management/README.md create mode 100644 rest/api/v3/ip_address_management/api_add_ip.go create mode 100644 rest/api/v3/ip_address_management/api_add_ips_to_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/api_add_sub_users_to_ip.go create mode 100644 rest/api/v3/ip_address_management/api_create_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/api_delete_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/api_delete_ips_from_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/api_delete_sub_users_from_ip.go create mode 100644 rest/api/v3/ip_address_management/api_get_ip.go create mode 100644 rest/api/v3/ip_address_management/api_get_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/api_list_ip.go create mode 100644 rest/api/v3/ip_address_management/api_list_ip_assigned_to_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/api_list_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/api_list_sub_user_assigned_to_ip.go create mode 100644 rest/api/v3/ip_address_management/api_service.go create mode 100644 rest/api/v3/ip_address_management/api_update_ip.go create mode 100644 rest/api/v3/ip_address_management/api_update_ip_pool.go create mode 100644 rest/api/v3/ip_address_management/docs/AddIp.md create mode 100644 rest/api/v3/ip_address_management/docs/AddIp201Response.md create mode 100644 rest/api/v3/ip_address_management/docs/AddIpRequest.md create mode 100644 rest/api/v3/ip_address_management/docs/AddIpsToIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/AddIpsToIpPool200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/AddIpsToIpPoolRequest.md create mode 100644 rest/api/v3/ip_address_management/docs/AddSubUsersToIp.md create mode 100644 rest/api/v3/ip_address_management/docs/AddSubUsersToIp200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/AddSubUsersToIpRequest.md create mode 100644 rest/api/v3/ip_address_management/docs/CreateIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/CreateIpPool201Response.md create mode 100644 rest/api/v3/ip_address_management/docs/CreateIpPoolRequest.md create mode 100644 rest/api/v3/ip_address_management/docs/DeleteIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPoolRequest.md create mode 100644 rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIp.md create mode 100644 rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIpRequest.md create mode 100644 rest/api/v3/ip_address_management/docs/GetIp.md create mode 100644 rest/api/v3/ip_address_management/docs/GetIp200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/GetIp200ResponsePoolsInner.md create mode 100644 rest/api/v3/ip_address_management/docs/GetIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/GetIpPool200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/GetIpPool200ResponseIpCountByRegionInner.md create mode 100644 rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponse.md create mode 100644 rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponseErrorsInner.md create mode 100644 rest/api/v3/ip_address_management/docs/Items.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIp.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIp200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadata.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadataNextParams.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInner.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInnerPoolsInner.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadata.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadataNextParams.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseResultInner.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpPool200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadata.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadataNextParams.md create mode 100644 rest/api/v3/ip_address_management/docs/ListIpPool200ResponseResultInner.md create mode 100644 rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp.md create mode 100644 rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadata.md create mode 100644 rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadataNextParams.md create mode 100644 rest/api/v3/ip_address_management/docs/Region.md create mode 100644 rest/api/v3/ip_address_management/docs/Region1.md create mode 100644 rest/api/v3/ip_address_management/docs/Region2.md create mode 100644 rest/api/v3/ip_address_management/docs/Region3.md create mode 100644 rest/api/v3/ip_address_management/docs/Region4.md create mode 100644 rest/api/v3/ip_address_management/docs/Region5.md create mode 100644 rest/api/v3/ip_address_management/docs/Region6.md create mode 100644 rest/api/v3/ip_address_management/docs/Region7.md create mode 100644 rest/api/v3/ip_address_management/docs/UpdateIp.md create mode 100644 rest/api/v3/ip_address_management/docs/UpdateIp200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/UpdateIpPool.md create mode 100644 rest/api/v3/ip_address_management/docs/UpdateIpPool200Response.md create mode 100644 rest/api/v3/ip_address_management/docs/UpdateIpPoolRequest.md create mode 100644 rest/api/v3/ip_address_management/docs/UpdateIpRequest.md create mode 100644 rest/api/v3/ip_address_management/model_add_ip_201_response.go create mode 100644 rest/api/v3/ip_address_management/model_add_ip_request.go create mode 100644 rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_request.go create mode 100644 rest/api/v3/ip_address_management/model_add_sub_users_to_ip_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_add_sub_users_to_ip_request.go create mode 100644 rest/api/v3/ip_address_management/model_create_ip_pool_201_response.go create mode 100644 rest/api/v3/ip_address_management/model_create_ip_pool_request.go create mode 100644 rest/api/v3/ip_address_management/model_delete_ips_from_ip_pool_request.go create mode 100644 rest/api/v3/ip_address_management/model_delete_sub_users_from_ip_request.go create mode 100644 rest/api/v3/ip_address_management/model_get_ip_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_get_ip_200_response_pools_inner.go create mode 100644 rest/api/v3/ip_address_management/model_get_ip_pool_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_get_ip_pool_200_response_ip_count_by_region_inner.go create mode 100644 rest/api/v3/ip_address_management/model_ip_address_management_error_response.go create mode 100644 rest/api/v3/ip_address_management/model_ip_address_management_error_response_errors_inner.go create mode 100644 rest/api/v3/ip_address_management/model_items.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_200_response__metadata.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_200_response__metadata_next_params.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner_pools_inner.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata_next_params.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response_result_inner.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_pool_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata_next_params.go create mode 100644 rest/api/v3/ip_address_management/model_list_ip_pool_200_response_result_inner.go create mode 100644 rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata.go create mode 100644 rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata_next_params.go create mode 100644 rest/api/v3/ip_address_management/model_region.go create mode 100644 rest/api/v3/ip_address_management/model_region1.go create mode 100644 rest/api/v3/ip_address_management/model_region2.go create mode 100644 rest/api/v3/ip_address_management/model_region3.go create mode 100644 rest/api/v3/ip_address_management/model_region4.go create mode 100644 rest/api/v3/ip_address_management/model_region5.go create mode 100644 rest/api/v3/ip_address_management/model_region6.go create mode 100644 rest/api/v3/ip_address_management/model_region7.go create mode 100644 rest/api/v3/ip_address_management/model_update_ip_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_update_ip_pool_200_response.go create mode 100644 rest/api/v3/ip_address_management/model_update_ip_pool_request.go create mode 100644 rest/api/v3/ip_address_management/model_update_ip_request.go create mode 100644 rest/api/v3/ip_warmup/README.md create mode 100644 rest/api/v3/ip_warmup/api_get_warm_up_ip.go create mode 100644 rest/api/v3/ip_warmup/api_list_warm_up_ip.go create mode 100644 rest/api/v3/ip_warmup/api_service.go create mode 100644 rest/api/v3/ip_warmup/api_stop_ip_warm_up.go create mode 100644 rest/api/v3/ip_warmup/api_warm_up_ip.go create mode 100644 rest/api/v3/ip_warmup/docs/GetWarmUpIp.md create mode 100644 rest/api/v3/ip_warmup/docs/GetWarmUpIp404Response.md create mode 100644 rest/api/v3/ip_warmup/docs/GetWarmUpIp404ResponseErrorsInner.md create mode 100644 rest/api/v3/ip_warmup/docs/IpWarmup200Inner.md create mode 100644 rest/api/v3/ip_warmup/docs/ListWarmUpIp.md create mode 100644 rest/api/v3/ip_warmup/docs/StopIpWarmUp.md create mode 100644 rest/api/v3/ip_warmup/docs/StopIpWarmUp404Response.md create mode 100644 rest/api/v3/ip_warmup/docs/StopIpWarmUp404ResponseErrorsInner.md create mode 100644 rest/api/v3/ip_warmup/docs/WarmUpIp.md create mode 100644 rest/api/v3/ip_warmup/docs/WarmUpIp404Response.md create mode 100644 rest/api/v3/ip_warmup/docs/WarmUpIp404ResponseErrorsInner.md create mode 100644 rest/api/v3/ip_warmup/docs/WarmUpIpRequest.md create mode 100644 rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response.go create mode 100644 rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response_errors_inner.go create mode 100644 rest/api/v3/ip_warmup/model_ip_warmup200_inner.go create mode 100644 rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response.go create mode 100644 rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response_errors_inner.go create mode 100644 rest/api/v3/ip_warmup/model_warm_up_ip_404_response.go create mode 100644 rest/api/v3/ip_warmup/model_warm_up_ip_404_response_errors_inner.go create mode 100644 rest/api/v3/ip_warmup/model_warm_up_ip_request.go create mode 100644 rest/api/v3/ips/README.md create mode 100644 rest/api/v3/ips/api_add_ip.go create mode 100644 rest/api/v3/ips/api_add_ip_to_ip_pool.go create mode 100644 rest/api/v3/ips/api_create_ip_pool.go create mode 100644 rest/api/v3/ips/api_delete_ip_from_ip_pool.go create mode 100644 rest/api/v3/ips/api_delete_ip_pool.go create mode 100644 rest/api/v3/ips/api_get_ip.go create mode 100644 rest/api/v3/ips/api_get_ip_pool.go create mode 100644 rest/api/v3/ips/api_list_assigned_ip.go create mode 100644 rest/api/v3/ips/api_list_ip.go create mode 100644 rest/api/v3/ips/api_list_ip_pool.go create mode 100644 rest/api/v3/ips/api_list_remaining_ip_count.go create mode 100644 rest/api/v3/ips/api_service.go create mode 100644 rest/api/v3/ips/api_update_ip_pool.go create mode 100644 rest/api/v3/ips/docs/AddIp.md create mode 100644 rest/api/v3/ips/docs/AddIp201Response.md create mode 100644 rest/api/v3/ips/docs/AddIp201ResponseIpsInner.md create mode 100644 rest/api/v3/ips/docs/AddIpRequest.md create mode 100644 rest/api/v3/ips/docs/AddIpToIpPool.md create mode 100644 rest/api/v3/ips/docs/AddIpToIpPool201Response.md create mode 100644 rest/api/v3/ips/docs/AddIpToIpPool404Response.md create mode 100644 rest/api/v3/ips/docs/AddIpToIpPool404ResponseErrorsInner.md create mode 100644 rest/api/v3/ips/docs/AddIpToIpPoolRequest.md create mode 100644 rest/api/v3/ips/docs/CreateIpPool.md create mode 100644 rest/api/v3/ips/docs/CreateIpPoolRequest.md create mode 100644 rest/api/v3/ips/docs/DeleteIpFromIpPool.md create mode 100644 rest/api/v3/ips/docs/DeleteIpFromIpPool404Response.md create mode 100644 rest/api/v3/ips/docs/DeleteIpPool.md create mode 100644 rest/api/v3/ips/docs/DeleteIpPool404Response.md create mode 100644 rest/api/v3/ips/docs/ErrorResponse.md create mode 100644 rest/api/v3/ips/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/ips/docs/GetIp.md create mode 100644 rest/api/v3/ips/docs/GetIp200Response.md create mode 100644 rest/api/v3/ips/docs/GetIpPool.md create mode 100644 rest/api/v3/ips/docs/GetIpPool200Response.md create mode 100644 rest/api/v3/ips/docs/GetIpPool404Response.md create mode 100644 rest/api/v3/ips/docs/GetIpPool404ResponseErrorsInner.md create mode 100644 rest/api/v3/ips/docs/IpPools200.md create mode 100644 rest/api/v3/ips/docs/ListAssignedIp.md create mode 100644 rest/api/v3/ips/docs/ListAssignedIp200ResponseInner.md create mode 100644 rest/api/v3/ips/docs/ListIp.md create mode 100644 rest/api/v3/ips/docs/ListIp200ResponseInner.md create mode 100644 rest/api/v3/ips/docs/ListIpPool.md create mode 100644 rest/api/v3/ips/docs/ListRemainingIpCount.md create mode 100644 rest/api/v3/ips/docs/ListRemainingIpCount200Response.md create mode 100644 rest/api/v3/ips/docs/ListRemainingIpCount200ResponseResultsInner.md create mode 100644 rest/api/v3/ips/docs/SortByDirection.md create mode 100644 rest/api/v3/ips/docs/UpdateIpPool.md create mode 100644 rest/api/v3/ips/docs/UpdateIpPool404Response.md create mode 100644 rest/api/v3/ips/docs/UpdateIpPool404ResponseErrorsInner.md create mode 100644 rest/api/v3/ips/docs/UpdateIpPoolRequest.md create mode 100644 rest/api/v3/ips/model_add_ip_201_response.go create mode 100644 rest/api/v3/ips/model_add_ip_201_response_ips_inner.go create mode 100644 rest/api/v3/ips/model_add_ip_request.go create mode 100644 rest/api/v3/ips/model_add_ip_to_ip_pool_201_response.go create mode 100644 rest/api/v3/ips/model_add_ip_to_ip_pool_404_response.go create mode 100644 rest/api/v3/ips/model_add_ip_to_ip_pool_404_response_errors_inner.go create mode 100644 rest/api/v3/ips/model_add_ip_to_ip_pool_request.go create mode 100644 rest/api/v3/ips/model_create_ip_pool_request.go create mode 100644 rest/api/v3/ips/model_delete_ip_from_ip_pool_404_response.go create mode 100644 rest/api/v3/ips/model_delete_ip_pool_404_response.go create mode 100644 rest/api/v3/ips/model_error_response.go create mode 100644 rest/api/v3/ips/model_error_response_errors_inner.go create mode 100644 rest/api/v3/ips/model_get_ip_200_response.go create mode 100644 rest/api/v3/ips/model_get_ip_pool_200_response.go create mode 100644 rest/api/v3/ips/model_get_ip_pool_404_response.go create mode 100644 rest/api/v3/ips/model_get_ip_pool_404_response_errors_inner.go create mode 100644 rest/api/v3/ips/model_ip_pools200.go create mode 100644 rest/api/v3/ips/model_list_assigned_ip_200_response_inner.go create mode 100644 rest/api/v3/ips/model_list_ip_200_response_inner.go create mode 100644 rest/api/v3/ips/model_list_remaining_ip_count_200_response.go create mode 100644 rest/api/v3/ips/model_list_remaining_ip_count_200_response_results_inner.go create mode 100644 rest/api/v3/ips/model_sort_by_direction.go create mode 100644 rest/api/v3/ips/model_update_ip_pool_404_response.go create mode 100644 rest/api/v3/ips/model_update_ip_pool_404_response_errors_inner.go create mode 100644 rest/api/v3/ips/model_update_ip_pool_request.go create mode 100644 rest/api/v3/link_branding/README.md create mode 100644 rest/api/v3/link_branding/api_associate_branded_link_with_subuser.go create mode 100644 rest/api/v3/link_branding/api_create_branded_link.go create mode 100644 rest/api/v3/link_branding/api_delete_branded_link.go create mode 100644 rest/api/v3/link_branding/api_disassociate_branded_link_from_subuser.go create mode 100644 rest/api/v3/link_branding/api_get_branded_link.go create mode 100644 rest/api/v3/link_branding/api_list_branded_link.go create mode 100644 rest/api/v3/link_branding/api_list_default_branded_link.go create mode 100644 rest/api/v3/link_branding/api_list_subuser_branded_link.go create mode 100644 rest/api/v3/link_branding/api_service.go create mode 100644 rest/api/v3/link_branding/api_update_branded_link.go create mode 100644 rest/api/v3/link_branding/api_validate_branded_link.go create mode 100644 rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuser.md create mode 100644 rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuserRequest.md create mode 100644 rest/api/v3/link_branding/docs/CreateBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/CreateBrandedLinkRequest.md create mode 100644 rest/api/v3/link_branding/docs/Default.md create mode 100644 rest/api/v3/link_branding/docs/Default1.md create mode 100644 rest/api/v3/link_branding/docs/Default2.md create mode 100644 rest/api/v3/link_branding/docs/DeleteBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/DisassociateBrandedLinkFromSubuser.md create mode 100644 rest/api/v3/link_branding/docs/GetBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/Legacy.md create mode 100644 rest/api/v3/link_branding/docs/LinkBranding200.md create mode 100644 rest/api/v3/link_branding/docs/LinkBranding200Dns.md create mode 100644 rest/api/v3/link_branding/docs/LinkBranding200DnsDomainCname.md create mode 100644 rest/api/v3/link_branding/docs/LinkBranding200DnsOwnerCname.md create mode 100644 rest/api/v3/link_branding/docs/ListBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/ListDefaultBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/ListSubuserBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/Region.md create mode 100644 rest/api/v3/link_branding/docs/Type.md create mode 100644 rest/api/v3/link_branding/docs/Type1.md create mode 100644 rest/api/v3/link_branding/docs/UpdateBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/UpdateBrandedLinkRequest.md create mode 100644 rest/api/v3/link_branding/docs/Valid.md create mode 100644 rest/api/v3/link_branding/docs/Valid1.md create mode 100644 rest/api/v3/link_branding/docs/Valid2.md create mode 100644 rest/api/v3/link_branding/docs/Valid3.md create mode 100644 rest/api/v3/link_branding/docs/Valid4.md create mode 100644 rest/api/v3/link_branding/docs/Valid5.md create mode 100644 rest/api/v3/link_branding/docs/ValidateBrandedLink.md create mode 100644 rest/api/v3/link_branding/docs/ValidateBrandedLink200Response.md create mode 100644 rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResults.md create mode 100644 rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsDomainCname.md create mode 100644 rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsOwnerCname.md create mode 100644 rest/api/v3/link_branding/docs/ValidateBrandedLink500Response.md create mode 100644 rest/api/v3/link_branding/docs/ValidateBrandedLink500ResponseErrorsInner.md create mode 100644 rest/api/v3/link_branding/model_associate_branded_link_with_subuser_request.go create mode 100644 rest/api/v3/link_branding/model_create_branded_link_request.go create mode 100644 rest/api/v3/link_branding/model_default.go create mode 100644 rest/api/v3/link_branding/model_default1.go create mode 100644 rest/api/v3/link_branding/model_default2.go create mode 100644 rest/api/v3/link_branding/model_legacy.go create mode 100644 rest/api/v3/link_branding/model_link_branding200.go create mode 100644 rest/api/v3/link_branding/model_link_branding200_dns.go create mode 100644 rest/api/v3/link_branding/model_link_branding200_dns_domain_cname.go create mode 100644 rest/api/v3/link_branding/model_link_branding200_dns_owner_cname.go create mode 100644 rest/api/v3/link_branding/model_region.go create mode 100644 rest/api/v3/link_branding/model_type.go create mode 100644 rest/api/v3/link_branding/model_type1.go create mode 100644 rest/api/v3/link_branding/model_update_branded_link_request.go create mode 100644 rest/api/v3/link_branding/model_valid.go create mode 100644 rest/api/v3/link_branding/model_valid1.go create mode 100644 rest/api/v3/link_branding/model_valid2.go create mode 100644 rest/api/v3/link_branding/model_valid3.go create mode 100644 rest/api/v3/link_branding/model_valid4.go create mode 100644 rest/api/v3/link_branding/model_valid5.go create mode 100644 rest/api/v3/link_branding/model_validate_branded_link_200_response.go create mode 100644 rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results.go create mode 100644 rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_domain_cname.go create mode 100644 rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_owner_cname.go create mode 100644 rest/api/v3/link_branding/model_validate_branded_link_500_response.go create mode 100644 rest/api/v3/link_branding/model_validate_branded_link_500_response_errors_inner.go create mode 100644 rest/api/v3/lmc_campaigns/README.md create mode 100644 rest/api/v3/lmc_campaigns/api_create_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_delete_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_get_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_get_scheduled_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_list_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_schedule_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_send_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_send_test_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_service.go create mode 100644 rest/api/v3/lmc_campaigns/api_un_schedule_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_update_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/api_update_scheduled_campaign.go create mode 100644 rest/api/v3/lmc_campaigns/docs/Campaigns2xx.md create mode 100644 rest/api/v3/lmc_campaigns/docs/CreateCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/DeleteCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/Editor.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ErrorResponse.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/lmc_campaigns/docs/GetCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/GetCampaign200Response.md create mode 100644 rest/api/v3/lmc_campaigns/docs/GetScheduledCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ListCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ListCampaign200Response.md create mode 100644 rest/api/v3/lmc_campaigns/docs/PostCampaignsRequest.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ScheduleACampaignRequest.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ScheduleACampaignResponse.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ScheduleCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/SendACampaignResponse.md create mode 100644 rest/api/v3/lmc_campaigns/docs/SendATestCampaignRequest.md create mode 100644 rest/api/v3/lmc_campaigns/docs/SendCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/SendTestCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/SendTestCampaignRequest.md create mode 100644 rest/api/v3/lmc_campaigns/docs/Status.md create mode 100644 rest/api/v3/lmc_campaigns/docs/UnScheduleCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/UpdateACampaignRequest.md create mode 100644 rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignRequest.md create mode 100644 rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignResponse.md create mode 100644 rest/api/v3/lmc_campaigns/docs/UpdateCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/UpdateScheduledCampaign.md create mode 100644 rest/api/v3/lmc_campaigns/docs/ViewScheduledTimeOfACampaignResponse.md create mode 100644 rest/api/v3/lmc_campaigns/model_campaigns2xx.go create mode 100644 rest/api/v3/lmc_campaigns/model_editor.go create mode 100644 rest/api/v3/lmc_campaigns/model_error_response.go create mode 100644 rest/api/v3/lmc_campaigns/model_error_response_errors_inner.go create mode 100644 rest/api/v3/lmc_campaigns/model_get_campaign_200_response.go create mode 100644 rest/api/v3/lmc_campaigns/model_list_campaign_200_response.go create mode 100644 rest/api/v3/lmc_campaigns/model_post_campaigns_request.go create mode 100644 rest/api/v3/lmc_campaigns/model_schedule_a_campaign_request.go create mode 100644 rest/api/v3/lmc_campaigns/model_schedule_a_campaign_response.go create mode 100644 rest/api/v3/lmc_campaigns/model_send_a_campaign_response.go create mode 100644 rest/api/v3/lmc_campaigns/model_send_a_test_campaign_request.go create mode 100644 rest/api/v3/lmc_campaigns/model_send_test_campaign_request.go create mode 100644 rest/api/v3/lmc_campaigns/model_status.go create mode 100644 rest/api/v3/lmc_campaigns/model_update_a_campaign_request.go create mode 100644 rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_request.go create mode 100644 rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_response.go create mode 100644 rest/api/v3/lmc_campaigns/model_view_scheduled_time_of_a_campaign_response.go create mode 100644 rest/api/v3/lmc_contactdb/README.md create mode 100644 rest/api/v3/lmc_contactdb/api_add_recipient.go create mode 100644 rest/api/v3/lmc_contactdb/api_add_recipient_to_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_add_recipients_to_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_create_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_create_custom_field.go create mode 100644 rest/api/v3/lmc_contactdb/api_create_segment.go create mode 100644 rest/api/v3/lmc_contactdb/api_delete_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_delete_contact_db_lists.go create mode 100644 rest/api/v3/lmc_contactdb/api_delete_custom_field.go create mode 100644 rest/api/v3/lmc_contactdb/api_delete_recipient.go create mode 100644 rest/api/v3/lmc_contactdb/api_delete_recipient_from_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_delete_recipients.go create mode 100644 rest/api/v3/lmc_contactdb/api_delete_segment.go create mode 100644 rest/api/v3/lmc_contactdb/api_get_billable.go create mode 100644 rest/api/v3/lmc_contactdb/api_get_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_get_custom_field.go create mode 100644 rest/api/v3/lmc_contactdb/api_get_recipient.go create mode 100644 rest/api/v3/lmc_contactdb/api_get_recipient_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_get_segment.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_custom_field.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_recipient.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_recipient_count.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_recipient_for_segment.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_recipients_from_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_reserved_field.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_search_recipient.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_segment.go create mode 100644 rest/api/v3/lmc_contactdb/api_list_status.go create mode 100644 rest/api/v3/lmc_contactdb/api_search_recipient.go create mode 100644 rest/api/v3/lmc_contactdb/api_service.go create mode 100644 rest/api/v3/lmc_contactdb/api_update_contact_db_list.go create mode 100644 rest/api/v3/lmc_contactdb/api_update_recipient.go create mode 100644 rest/api/v3/lmc_contactdb/api_update_segment.go create mode 100644 rest/api/v3/lmc_contactdb/docs/AddRecipient.md create mode 100644 rest/api/v3/lmc_contactdb/docs/AddRecipientRequestInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/AddRecipientToContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/AddRecipientsToContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/AndOr.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbCustomField.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldId2xx.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldIdValue.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbList2xx.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200RecipientsInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbRecipientCount200.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201ErrorsInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbSegments.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsConditions.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsId200.md create mode 100644 rest/api/v3/lmc_contactdb/docs/CreateAListRequest.md create mode 100644 rest/api/v3/lmc_contactdb/docs/CreateContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/CreateCustomField.md create mode 100644 rest/api/v3/lmc_contactdb/docs/CreateCustomFieldRequest.md create mode 100644 rest/api/v3/lmc_contactdb/docs/CreateSegment.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteContactDbLists.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteContacts.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteCustomField.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteRecipient.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteRecipientFromContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteRecipients.md create mode 100644 rest/api/v3/lmc_contactdb/docs/DeleteSegment.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ErrorResponse.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/GetBillable.md create mode 100644 rest/api/v3/lmc_contactdb/docs/GetContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/GetCustomField.md create mode 100644 rest/api/v3/lmc_contactdb/docs/GetRecipient.md create mode 100644 rest/api/v3/lmc_contactdb/docs/GetRecipientList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/GetRecipientList200Response.md create mode 100644 rest/api/v3/lmc_contactdb/docs/GetSegment.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListAllCustomFieldsResponse.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListAllListsResponse.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListAllSegmentsResponse.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListCustomField.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListRecipient.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListRecipientCount.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListRecipientForSegment.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList200Response.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListRecipientsOnASegmentResponse.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListRecipientsResponse.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListReservedField.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListReservedField200Response.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListReservedField200ResponseReservedFieldsInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListSearchRecipient.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListSegment.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListStatus.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListStatus200Response.md create mode 100644 rest/api/v3/lmc_contactdb/docs/ListStatus200ResponseStatusInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/Operator.md create mode 100644 rest/api/v3/lmc_contactdb/docs/SearchRecipient.md create mode 100644 rest/api/v3/lmc_contactdb/docs/SearchRecipient200Response.md create mode 100644 rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue.md create mode 100644 rest/api/v3/lmc_contactdb/docs/SearchRecipientRequest.md create mode 100644 rest/api/v3/lmc_contactdb/docs/Type.md create mode 100644 rest/api/v3/lmc_contactdb/docs/UpdateAListRequest.md create mode 100644 rest/api/v3/lmc_contactdb/docs/UpdateContactDbList.md create mode 100644 rest/api/v3/lmc_contactdb/docs/UpdateContactDbList200Response.md create mode 100644 rest/api/v3/lmc_contactdb/docs/UpdateRecipient.md create mode 100644 rest/api/v3/lmc_contactdb/docs/UpdateRecipientRequestInner.md create mode 100644 rest/api/v3/lmc_contactdb/docs/UpdateSegment.md create mode 100644 rest/api/v3/lmc_contactdb/docs/UpdateSegmentRequest.md create mode 100644 rest/api/v3/lmc_contactdb/model_add_recipient_request_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_and_or.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_custom_field.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id2xx.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id_value.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_list2xx.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_recipient200.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_recipient200_recipients_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_recipient_count200.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201_errors_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_segments.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_segments_conditions.go create mode 100644 rest/api/v3/lmc_contactdb/model_contactdb_segments_id200.go create mode 100644 rest/api/v3/lmc_contactdb/model_create_a_list_request.go create mode 100644 rest/api/v3/lmc_contactdb/model_create_custom_field_request.go create mode 100644 rest/api/v3/lmc_contactdb/model_delete_contacts.go create mode 100644 rest/api/v3/lmc_contactdb/model_error_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_error_response_errors_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_get_recipient_list_200_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_all_custom_fields_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_all_lists_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_all_segments_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_recipients_from_contact_db_list_200_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_recipients_on_a_segment_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_recipients_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response_reserved_fields_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_status_200_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_list_status_200_response_status_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_operator.go create mode 100644 rest/api/v3/lmc_contactdb/model_search_recipient_200_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner_value.go create mode 100644 rest/api/v3/lmc_contactdb/model_search_recipient_request.go create mode 100644 rest/api/v3/lmc_contactdb/model_type.go create mode 100644 rest/api/v3/lmc_contactdb/model_update_a_list_request.go create mode 100644 rest/api/v3/lmc_contactdb/model_update_contact_db_list_200_response.go create mode 100644 rest/api/v3/lmc_contactdb/model_update_recipient_request_inner.go create mode 100644 rest/api/v3/lmc_contactdb/model_update_segment_request.go create mode 100644 rest/api/v3/lmc_senders/README.md create mode 100644 rest/api/v3/lmc_senders/api_create_sender.go create mode 100644 rest/api/v3/lmc_senders/api_delete_sender.go create mode 100644 rest/api/v3/lmc_senders/api_get_sender.go create mode 100644 rest/api/v3/lmc_senders/api_list_sender.go create mode 100644 rest/api/v3/lmc_senders/api_reset_sender_verification.go create mode 100644 rest/api/v3/lmc_senders/api_service.go create mode 100644 rest/api/v3/lmc_senders/api_update_sender.go create mode 100644 rest/api/v3/lmc_senders/docs/CreateSender.md create mode 100644 rest/api/v3/lmc_senders/docs/CreateSender400Response.md create mode 100644 rest/api/v3/lmc_senders/docs/CreateSender400ResponseErrorsInner.md create mode 100644 rest/api/v3/lmc_senders/docs/CreateSenderRequest.md create mode 100644 rest/api/v3/lmc_senders/docs/DeleteSender.md create mode 100644 rest/api/v3/lmc_senders/docs/GetSender.md create mode 100644 rest/api/v3/lmc_senders/docs/ListSender.md create mode 100644 rest/api/v3/lmc_senders/docs/ListSender200Response.md create mode 100644 rest/api/v3/lmc_senders/docs/ResetSenderVerification.md create mode 100644 rest/api/v3/lmc_senders/docs/SenderId.md create mode 100644 rest/api/v3/lmc_senders/docs/SenderIdRequest.md create mode 100644 rest/api/v3/lmc_senders/docs/SenderIdRequestFrom.md create mode 100644 rest/api/v3/lmc_senders/docs/SenderIdRequestReplyTo.md create mode 100644 rest/api/v3/lmc_senders/docs/UpdateSender.md create mode 100644 rest/api/v3/lmc_senders/model_create_sender_400_response.go create mode 100644 rest/api/v3/lmc_senders/model_create_sender_400_response_errors_inner.go create mode 100644 rest/api/v3/lmc_senders/model_create_sender_request.go create mode 100644 rest/api/v3/lmc_senders/model_list_sender_200_response.go create mode 100644 rest/api/v3/lmc_senders/model_sender_id.go create mode 100644 rest/api/v3/lmc_senders/model_sender_id_request.go create mode 100644 rest/api/v3/lmc_senders/model_sender_id_request_from.go create mode 100644 rest/api/v3/lmc_senders/model_sender_id_request_reply_to.go create mode 100644 rest/api/v3/mail/README.md create mode 100644 rest/api/v3/mail/api_create_mail_batch.go create mode 100644 rest/api/v3/mail/api_get_mail_batch.go create mode 100644 rest/api/v3/mail/api_send_mail.go create mode 100644 rest/api/v3/mail/api_service.go create mode 100644 rest/api/v3/mail/docs/ContentEncoding.md create mode 100644 rest/api/v3/mail/docs/CreateMailBatch.md create mode 100644 rest/api/v3/mail/docs/Disposition.md create mode 100644 rest/api/v3/mail/docs/ErrorResponse.md create mode 100644 rest/api/v3/mail/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/mail/docs/GetMailBatch.md create mode 100644 rest/api/v3/mail/docs/MailBatchResponse.md create mode 100644 rest/api/v3/mail/docs/MailFrom.md create mode 100644 rest/api/v3/mail/docs/MailTo.md create mode 100644 rest/api/v3/mail/docs/SendMail.md create mode 100644 rest/api/v3/mail/docs/SendMailRequest.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestAsm.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestAttachmentsInner.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestContentInner.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestMailSettings.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassBounceManagement.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassListManagement.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassSpamManagement.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassUnsubscribeManagement.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestMailSettingsFooter.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestMailSettingsSandboxMode.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestPersonalizationsInner.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestTrackingSettings.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestTrackingSettingsClickTracking.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestTrackingSettingsGanalytics.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestTrackingSettingsOpenTracking.md create mode 100644 rest/api/v3/mail/docs/SendMailRequestTrackingSettingsSubscriptionTracking.md create mode 100644 rest/api/v3/mail/model_content_encoding.go create mode 100644 rest/api/v3/mail/model_disposition.go create mode 100644 rest/api/v3/mail/model_error_response.go create mode 100644 rest/api/v3/mail/model_error_response_errors_inner.go create mode 100644 rest/api/v3/mail/model_mail_batch_response.go create mode 100644 rest/api/v3/mail/model_mail_from.go create mode 100644 rest/api/v3/mail/model_mail_to.go create mode 100644 rest/api/v3/mail/model_send_mail_request.go create mode 100644 rest/api/v3/mail/model_send_mail_request_asm.go create mode 100644 rest/api/v3/mail/model_send_mail_request_attachments_inner.go create mode 100644 rest/api/v3/mail/model_send_mail_request_content_inner.go create mode 100644 rest/api/v3/mail/model_send_mail_request_mail_settings.go create mode 100644 rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_bounce_management.go create mode 100644 rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_list_management.go create mode 100644 rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_spam_management.go create mode 100644 rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_unsubscribe_management.go create mode 100644 rest/api/v3/mail/model_send_mail_request_mail_settings_footer.go create mode 100644 rest/api/v3/mail/model_send_mail_request_mail_settings_sandbox_mode.go create mode 100644 rest/api/v3/mail/model_send_mail_request_personalizations_inner.go create mode 100644 rest/api/v3/mail/model_send_mail_request_tracking_settings.go create mode 100644 rest/api/v3/mail/model_send_mail_request_tracking_settings_click_tracking.go create mode 100644 rest/api/v3/mail/model_send_mail_request_tracking_settings_ganalytics.go create mode 100644 rest/api/v3/mail/model_send_mail_request_tracking_settings_open_tracking.go create mode 100644 rest/api/v3/mail/model_send_mail_request_tracking_settings_subscription_tracking.go create mode 100644 rest/api/v3/mail_settings/README.md create mode 100644 rest/api/v3/mail_settings/api_list_address_whitelist.go create mode 100644 rest/api/v3/mail_settings/api_list_bounce_purge.go create mode 100644 rest/api/v3/mail_settings/api_list_footer.go create mode 100644 rest/api/v3/mail_settings/api_list_forward_bounce.go create mode 100644 rest/api/v3/mail_settings/api_list_forward_spam.go create mode 100644 rest/api/v3/mail_settings/api_list_mail_setting.go create mode 100644 rest/api/v3/mail_settings/api_list_template.go create mode 100644 rest/api/v3/mail_settings/api_service.go create mode 100644 rest/api/v3/mail_settings/api_update_address_whitelist.go create mode 100644 rest/api/v3/mail_settings/api_update_bounce_purge.go create mode 100644 rest/api/v3/mail_settings/api_update_footer.go create mode 100644 rest/api/v3/mail_settings/api_update_forward_bounce.go create mode 100644 rest/api/v3/mail_settings/api_update_forward_spam.go create mode 100644 rest/api/v3/mail_settings/api_update_template.go create mode 100644 rest/api/v3/mail_settings/docs/ListAddressWhitelist.md create mode 100644 rest/api/v3/mail_settings/docs/ListBouncePurge.md create mode 100644 rest/api/v3/mail_settings/docs/ListFooter.md create mode 100644 rest/api/v3/mail_settings/docs/ListForwardBounce.md create mode 100644 rest/api/v3/mail_settings/docs/ListForwardSpam.md create mode 100644 rest/api/v3/mail_settings/docs/ListMailSetting.md create mode 100644 rest/api/v3/mail_settings/docs/ListMailSetting200Response.md create mode 100644 rest/api/v3/mail_settings/docs/ListMailSetting200ResponseResultInner.md create mode 100644 rest/api/v3/mail_settings/docs/ListTemplate.md create mode 100644 rest/api/v3/mail_settings/docs/MailSettingsAddressWhitelabel200.md create mode 100644 rest/api/v3/mail_settings/docs/MailSettingsBouncePurge.md create mode 100644 rest/api/v3/mail_settings/docs/MailSettingsFooter.md create mode 100644 rest/api/v3/mail_settings/docs/MailSettingsForwardBounce.md create mode 100644 rest/api/v3/mail_settings/docs/MailSettingsForwardSpam.md create mode 100644 rest/api/v3/mail_settings/docs/MailSettingsTemplate200.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateAddressWhitelist.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateAddressWhitelistRequest.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateBouncePurge.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateFooter.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateForwardBounce.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateForwardSpam.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateTemplate.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateTemplate200Response.md create mode 100644 rest/api/v3/mail_settings/docs/UpdateTemplateRequest.md create mode 100644 rest/api/v3/mail_settings/model_list_mail_setting_200_response.go create mode 100644 rest/api/v3/mail_settings/model_list_mail_setting_200_response_result_inner.go create mode 100644 rest/api/v3/mail_settings/model_mail_settings_address_whitelabel200.go create mode 100644 rest/api/v3/mail_settings/model_mail_settings_bounce_purge.go create mode 100644 rest/api/v3/mail_settings/model_mail_settings_footer.go create mode 100644 rest/api/v3/mail_settings/model_mail_settings_forward_bounce.go create mode 100644 rest/api/v3/mail_settings/model_mail_settings_forward_spam.go create mode 100644 rest/api/v3/mail_settings/model_mail_settings_template200.go create mode 100644 rest/api/v3/mail_settings/model_update_address_whitelist_request.go create mode 100644 rest/api/v3/mail_settings/model_update_template_200_response.go create mode 100644 rest/api/v3/mail_settings/model_update_template_request.go create mode 100644 rest/api/v3/mc_custom_fields/README.md create mode 100644 rest/api/v3/mc_custom_fields/api_create_field_definition.go create mode 100644 rest/api/v3/mc_custom_fields/api_delete_field_definition.go create mode 100644 rest/api/v3/mc_custom_fields/api_list_field_definition.go create mode 100644 rest/api/v3/mc_custom_fields/api_service.go create mode 100644 rest/api/v3/mc_custom_fields/api_update_field_definition.go create mode 100644 rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition.md create mode 100644 rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition200Response.md create mode 100644 rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition400Response.md create mode 100644 rest/api/v3/mc_custom_fields/docs/CreateFieldDefinitionRequest.md create mode 100644 rest/api/v3/mc_custom_fields/docs/CustomFieldDefinitionsResponse.md create mode 100644 rest/api/v3/mc_custom_fields/docs/CustomFieldsError.md create mode 100644 rest/api/v3/mc_custom_fields/docs/DeleteFieldDefinition.md create mode 100644 rest/api/v3/mc_custom_fields/docs/FieldType.md create mode 100644 rest/api/v3/mc_custom_fields/docs/FieldType1.md create mode 100644 rest/api/v3/mc_custom_fields/docs/FieldType2.md create mode 100644 rest/api/v3/mc_custom_fields/docs/ListFieldDefinition.md create mode 100644 rest/api/v3/mc_custom_fields/docs/ListFieldDefinition200Response.md create mode 100644 rest/api/v3/mc_custom_fields/docs/Metadata.md create mode 100644 rest/api/v3/mc_custom_fields/docs/ReservedFieldDefinitionsResponseInner.md create mode 100644 rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinition.md create mode 100644 rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinitionRequest.md create mode 100644 rest/api/v3/mc_custom_fields/model_create_field_definition_200_response.go create mode 100644 rest/api/v3/mc_custom_fields/model_create_field_definition_400_response.go create mode 100644 rest/api/v3/mc_custom_fields/model_create_field_definition_request.go create mode 100644 rest/api/v3/mc_custom_fields/model_custom_field_definitions_response.go create mode 100644 rest/api/v3/mc_custom_fields/model_custom_fields_error.go create mode 100644 rest/api/v3/mc_custom_fields/model_field_type.go create mode 100644 rest/api/v3/mc_custom_fields/model_field_type1.go create mode 100644 rest/api/v3/mc_custom_fields/model_field_type2.go create mode 100644 rest/api/v3/mc_custom_fields/model_list_field_definition_200_response.go create mode 100644 rest/api/v3/mc_custom_fields/model_metadata.go create mode 100644 rest/api/v3/mc_custom_fields/model_reserved_field_definitions_response_inner.go create mode 100644 rest/api/v3/mc_custom_fields/model_update_field_definition_request.go create mode 100644 rest/api/v3/mc_designs/README.md create mode 100644 rest/api/v3/mc_designs/api_create_design.go create mode 100644 rest/api/v3/mc_designs/api_delete_design.go create mode 100644 rest/api/v3/mc_designs/api_duplicate_design.go create mode 100644 rest/api/v3/mc_designs/api_duplicate_pre_built_design.go create mode 100644 rest/api/v3/mc_designs/api_get_design.go create mode 100644 rest/api/v3/mc_designs/api_get_pre_built_design.go create mode 100644 rest/api/v3/mc_designs/api_list_design.go create mode 100644 rest/api/v3/mc_designs/api_list_pre_built_design.go create mode 100644 rest/api/v3/mc_designs/api_service.go create mode 100644 rest/api/v3/mc_designs/api_update_design.go create mode 100644 rest/api/v3/mc_designs/docs/ApiError.md create mode 100644 rest/api/v3/mc_designs/docs/ApiErrors.md create mode 100644 rest/api/v3/mc_designs/docs/CreateDesign.md create mode 100644 rest/api/v3/mc_designs/docs/DeleteDesign.md create mode 100644 rest/api/v3/mc_designs/docs/DesignCommonProperties.md create mode 100644 rest/api/v3/mc_designs/docs/DesignDuplicateInput.md create mode 100644 rest/api/v3/mc_designs/docs/DesignInput.md create mode 100644 rest/api/v3/mc_designs/docs/DesignOutput.md create mode 100644 rest/api/v3/mc_designs/docs/DesignOutputSummary.md create mode 100644 rest/api/v3/mc_designs/docs/DuplicateDesign.md create mode 100644 rest/api/v3/mc_designs/docs/DuplicatePreBuiltDesign.md create mode 100644 rest/api/v3/mc_designs/docs/Editor.md create mode 100644 rest/api/v3/mc_designs/docs/GetDesign.md create mode 100644 rest/api/v3/mc_designs/docs/GetPreBuiltDesign.md create mode 100644 rest/api/v3/mc_designs/docs/ListDesign.md create mode 100644 rest/api/v3/mc_designs/docs/ListDesign200Response.md create mode 100644 rest/api/v3/mc_designs/docs/ListPreBuiltDesign.md create mode 100644 rest/api/v3/mc_designs/docs/Metadata.md create mode 100644 rest/api/v3/mc_designs/docs/UpdateDesign.md create mode 100644 rest/api/v3/mc_designs/docs/UpdateDesignRequest.md create mode 100644 rest/api/v3/mc_designs/model_api_error.go create mode 100644 rest/api/v3/mc_designs/model_api_errors.go create mode 100644 rest/api/v3/mc_designs/model_design_common_properties.go create mode 100644 rest/api/v3/mc_designs/model_design_duplicate_input.go create mode 100644 rest/api/v3/mc_designs/model_design_input.go create mode 100644 rest/api/v3/mc_designs/model_design_output.go create mode 100644 rest/api/v3/mc_designs/model_design_output_summary.go create mode 100644 rest/api/v3/mc_designs/model_editor.go create mode 100644 rest/api/v3/mc_designs/model_list_design_200_response.go create mode 100644 rest/api/v3/mc_designs/model_metadata.go create mode 100644 rest/api/v3/mc_designs/model_update_design_request.go create mode 100644 rest/api/v3/mc_lists/README.md create mode 100644 rest/api/v3/mc_lists/api_create_marketing_list.go create mode 100644 rest/api/v3/mc_lists/api_delete_contact.go create mode 100644 rest/api/v3/mc_lists/api_delete_marketing_list.go create mode 100644 rest/api/v3/mc_lists/api_get_marketing_list.go create mode 100644 rest/api/v3/mc_lists/api_list_contact_count.go create mode 100644 rest/api/v3/mc_lists/api_list_marketing_list.go create mode 100644 rest/api/v3/mc_lists/api_service.go create mode 100644 rest/api/v3/mc_lists/api_update_marketing_list.go create mode 100644 rest/api/v3/mc_lists/docs/ContactDetails.md create mode 100644 rest/api/v3/mc_lists/docs/CreateMarketingList.md create mode 100644 rest/api/v3/mc_lists/docs/CreateMarketingList400Response.md create mode 100644 rest/api/v3/mc_lists/docs/CreateMarketingListRequest.md create mode 100644 rest/api/v3/mc_lists/docs/DeleteContact.md create mode 100644 rest/api/v3/mc_lists/docs/DeleteContact202Response.md create mode 100644 rest/api/v3/mc_lists/docs/DeleteMarketingList.md create mode 100644 rest/api/v3/mc_lists/docs/DeleteMarketingList200Response.md create mode 100644 rest/api/v3/mc_lists/docs/DeleteMarketingList404Response.md create mode 100644 rest/api/v3/mc_lists/docs/Error.md create mode 100644 rest/api/v3/mc_lists/docs/GetMarketingList.md create mode 100644 rest/api/v3/mc_lists/docs/GetMarketingList200Response.md create mode 100644 rest/api/v3/mc_lists/docs/List.md create mode 100644 rest/api/v3/mc_lists/docs/ListContactCount.md create mode 100644 rest/api/v3/mc_lists/docs/ListContactCount200Response.md create mode 100644 rest/api/v3/mc_lists/docs/ListMarketingList.md create mode 100644 rest/api/v3/mc_lists/docs/ListMarketingList200Response.md create mode 100644 rest/api/v3/mc_lists/docs/Metadata.md create mode 100644 rest/api/v3/mc_lists/docs/SelfMetadata.md create mode 100644 rest/api/v3/mc_lists/docs/UpdateMarketingList.md create mode 100644 rest/api/v3/mc_lists/docs/UpdateMarketingListRequest.md create mode 100644 rest/api/v3/mc_lists/model_contact_details.go create mode 100644 rest/api/v3/mc_lists/model_create_marketing_list_400_response.go create mode 100644 rest/api/v3/mc_lists/model_create_marketing_list_request.go create mode 100644 rest/api/v3/mc_lists/model_delete_contact_202_response.go create mode 100644 rest/api/v3/mc_lists/model_delete_marketing_list_200_response.go create mode 100644 rest/api/v3/mc_lists/model_delete_marketing_list_404_response.go create mode 100644 rest/api/v3/mc_lists/model_error.go create mode 100644 rest/api/v3/mc_lists/model_get_marketing_list_200_response.go create mode 100644 rest/api/v3/mc_lists/model_list.go create mode 100644 rest/api/v3/mc_lists/model_list_contact_count_200_response.go create mode 100644 rest/api/v3/mc_lists/model_list_marketing_list_200_response.go create mode 100644 rest/api/v3/mc_lists/model_metadata.go create mode 100644 rest/api/v3/mc_lists/model_self_metadata.go create mode 100644 rest/api/v3/mc_lists/model_update_marketing_list_request.go create mode 100644 rest/api/v3/mc_segments/README.md create mode 100644 rest/api/v3/mc_segments/api_delete_segment.go create mode 100644 rest/api/v3/mc_segments/api_get_segment.go create mode 100644 rest/api/v3/mc_segments/api_list_segment.go create mode 100644 rest/api/v3/mc_segments/api_service.go create mode 100644 rest/api/v3/mc_segments/docs/ContactResponse.md create mode 100644 rest/api/v3/mc_segments/docs/ContactResponseCustomFields.md create mode 100644 rest/api/v3/mc_segments/docs/DeleteSegment.md create mode 100644 rest/api/v3/mc_segments/docs/ErrorResponse.md create mode 100644 rest/api/v3/mc_segments/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/mc_segments/docs/FullSegment.md create mode 100644 rest/api/v3/mc_segments/docs/GetSegment.md create mode 100644 rest/api/v3/mc_segments/docs/GetSegment404Response.md create mode 100644 rest/api/v3/mc_segments/docs/GetSegment404ResponseErrorsInner.md create mode 100644 rest/api/v3/mc_segments/docs/ListSegment.md create mode 100644 rest/api/v3/mc_segments/docs/ListSegment200Response.md create mode 100644 rest/api/v3/mc_segments/docs/ListSegment500Response.md create mode 100644 rest/api/v3/mc_segments/docs/ListSegment500ResponseErrorsInner.md create mode 100644 rest/api/v3/mc_segments/docs/SegmentSummary.md create mode 100644 rest/api/v3/mc_segments/docs/SegmentWriteV2.md create mode 100644 rest/api/v3/mc_segments/model_contact_response.go create mode 100644 rest/api/v3/mc_segments/model_contact_response_custom_fields.go create mode 100644 rest/api/v3/mc_segments/model_error_response.go create mode 100644 rest/api/v3/mc_segments/model_error_response_errors_inner.go create mode 100644 rest/api/v3/mc_segments/model_full_segment.go create mode 100644 rest/api/v3/mc_segments/model_get_segment_404_response.go create mode 100644 rest/api/v3/mc_segments/model_get_segment_404_response_errors_inner.go create mode 100644 rest/api/v3/mc_segments/model_list_segment_200_response.go create mode 100644 rest/api/v3/mc_segments/model_list_segment_500_response.go create mode 100644 rest/api/v3/mc_segments/model_list_segment_500_response_errors_inner.go create mode 100644 rest/api/v3/mc_segments/model_segment_summary.go create mode 100644 rest/api/v3/mc_segments/model_segment_write_v2.go create mode 100644 rest/api/v3/mc_segments_2/README.md create mode 100644 rest/api/v3/mc_segments_2/api_create_segment.go create mode 100644 rest/api/v3/mc_segments_2/api_delete_segment.go create mode 100644 rest/api/v3/mc_segments_2/api_get_segment.go create mode 100644 rest/api/v3/mc_segments_2/api_list_segment.go create mode 100644 rest/api/v3/mc_segments_2/api_refresh_segment.go create mode 100644 rest/api/v3/mc_segments_2/api_service.go create mode 100644 rest/api/v3/mc_segments_2/api_update_segment.go create mode 100644 rest/api/v3/mc_segments_2/docs/AllSegments200.md create mode 100644 rest/api/v3/mc_segments_2/docs/ContactResponse.md create mode 100644 rest/api/v3/mc_segments_2/docs/ContactResponseCustomFields.md create mode 100644 rest/api/v3/mc_segments_2/docs/CreateSegment.md create mode 100644 rest/api/v3/mc_segments_2/docs/DeleteSegment.md create mode 100644 rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2.md create mode 100644 rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2ErrorsInner.md create mode 100644 rest/api/v3/mc_segments_2/docs/GetSegment.md create mode 100644 rest/api/v3/mc_segments_2/docs/ListSegment.md create mode 100644 rest/api/v3/mc_segments_2/docs/Metadata.md create mode 100644 rest/api/v3/mc_segments_2/docs/RefreshSegment.md create mode 100644 rest/api/v3/mc_segments_2/docs/Segment2xx.md create mode 100644 rest/api/v3/mc_segments_2/docs/SegmentError.md create mode 100644 rest/api/v3/mc_segments_2/docs/SegmentRefresh202.md create mode 100644 rest/api/v3/mc_segments_2/docs/SegmentRefreshRequest.md create mode 100644 rest/api/v3/mc_segments_2/docs/SegmentStatusResponse.md create mode 100644 rest/api/v3/mc_segments_2/docs/SegmentUpdate.md create mode 100644 rest/api/v3/mc_segments_2/docs/SegmentWriteV2.md create mode 100644 rest/api/v3/mc_segments_2/docs/UpdateSegment.md create mode 100644 rest/api/v3/mc_segments_2/model_all_segments200.go create mode 100644 rest/api/v3/mc_segments_2/model_contact_response.go create mode 100644 rest/api/v3/mc_segments_2/model_contact_response_custom_fields.go create mode 100644 rest/api/v3/mc_segments_2/model_errors_segment_v2.go create mode 100644 rest/api/v3/mc_segments_2/model_errors_segment_v2_errors_inner.go create mode 100644 rest/api/v3/mc_segments_2/model_metadata.go create mode 100644 rest/api/v3/mc_segments_2/model_segment2xx.go create mode 100644 rest/api/v3/mc_segments_2/model_segment_error.go create mode 100644 rest/api/v3/mc_segments_2/model_segment_refresh202.go create mode 100644 rest/api/v3/mc_segments_2/model_segment_refresh_request.go create mode 100644 rest/api/v3/mc_segments_2/model_segment_status_response.go create mode 100644 rest/api/v3/mc_segments_2/model_segment_update.go create mode 100644 rest/api/v3/mc_segments_2/model_segment_write_v2.go create mode 100644 rest/api/v3/mc_senders/README.md create mode 100644 rest/api/v3/mc_senders/api_create_sender.go create mode 100644 rest/api/v3/mc_senders/api_delete_sender.go create mode 100644 rest/api/v3/mc_senders/api_get_sender.go create mode 100644 rest/api/v3/mc_senders/api_list_sender.go create mode 100644 rest/api/v3/mc_senders/api_reset_sender_verification.go create mode 100644 rest/api/v3/mc_senders/api_service.go create mode 100644 rest/api/v3/mc_senders/api_update_sender.go create mode 100644 rest/api/v3/mc_senders/docs/CreateSender.md create mode 100644 rest/api/v3/mc_senders/docs/CreateSenderRequest.md create mode 100644 rest/api/v3/mc_senders/docs/CreateSenderRequestFrom.md create mode 100644 rest/api/v3/mc_senders/docs/CreateSenderRequestReplyTo.md create mode 100644 rest/api/v3/mc_senders/docs/DeleteSender.md create mode 100644 rest/api/v3/mc_senders/docs/ErrorResponse.md create mode 100644 rest/api/v3/mc_senders/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/mc_senders/docs/GetSender.md create mode 100644 rest/api/v3/mc_senders/docs/ListSender.md create mode 100644 rest/api/v3/mc_senders/docs/ListSender200Response.md create mode 100644 rest/api/v3/mc_senders/docs/ResetSenderVerification.md create mode 100644 rest/api/v3/mc_senders/docs/Sender.md create mode 100644 rest/api/v3/mc_senders/docs/SenderRequest.md create mode 100644 rest/api/v3/mc_senders/docs/SenderRequestFrom.md create mode 100644 rest/api/v3/mc_senders/docs/SenderRequestReplyTo.md create mode 100644 rest/api/v3/mc_senders/docs/UpdateSender.md create mode 100644 rest/api/v3/mc_senders/model_create_sender_request.go create mode 100644 rest/api/v3/mc_senders/model_create_sender_request_from.go create mode 100644 rest/api/v3/mc_senders/model_create_sender_request_reply_to.go create mode 100644 rest/api/v3/mc_senders/model_error_response.go create mode 100644 rest/api/v3/mc_senders/model_error_response_errors_inner.go create mode 100644 rest/api/v3/mc_senders/model_list_sender_200_response.go create mode 100644 rest/api/v3/mc_senders/model_sender.go create mode 100644 rest/api/v3/mc_senders/model_sender_request.go create mode 100644 rest/api/v3/mc_senders/model_sender_request_from.go create mode 100644 rest/api/v3/mc_senders/model_sender_request_reply_to.go create mode 100644 rest/api/v3/mc_singlesends/README.md create mode 100644 rest/api/v3/mc_singlesends/api_create_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_delete_scheduled_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_delete_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_delete_single_sends.go create mode 100644 rest/api/v3/mc_singlesends/api_duplicate_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_get_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_list_category.go create mode 100644 rest/api/v3/mc_singlesends/api_list_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_schedule_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_search_single_send.go create mode 100644 rest/api/v3/mc_singlesends/api_service.go create mode 100644 rest/api/v3/mc_singlesends/api_update_single_send.go create mode 100644 rest/api/v3/mc_singlesends/docs/AbTestSummary.md create mode 100644 rest/api/v3/mc_singlesends/docs/CreateSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/DeleteScheduledSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/DeleteSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/DeleteSingleSends.md create mode 100644 rest/api/v3/mc_singlesends/docs/DuplicateSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/DuplicateSingleSendRequest.md create mode 100644 rest/api/v3/mc_singlesends/docs/Editor.md create mode 100644 rest/api/v3/mc_singlesends/docs/Editor1.md create mode 100644 rest/api/v3/mc_singlesends/docs/GetSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/Items.md create mode 100644 rest/api/v3/mc_singlesends/docs/ListCategory.md create mode 100644 rest/api/v3/mc_singlesends/docs/ListCategory200Response.md create mode 100644 rest/api/v3/mc_singlesends/docs/ListSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/ListSingleSend200Response.md create mode 100644 rest/api/v3/mc_singlesends/docs/ListSingleSend500Response.md create mode 100644 rest/api/v3/mc_singlesends/docs/ListSingleSend500ResponseErrorsInner.md create mode 100644 rest/api/v3/mc_singlesends/docs/Metadata.md create mode 100644 rest/api/v3/mc_singlesends/docs/ScheduleSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/ScheduleSingleSend201Response.md create mode 100644 rest/api/v3/mc_singlesends/docs/ScheduleSingleSendRequest.md create mode 100644 rest/api/v3/mc_singlesends/docs/SearchSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendRequest.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendRequestEmailConfig.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendRequestSendTo.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendResponse.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendResponseEmailConfig.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendResponseSendTo.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendResponseShort.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendResponseWarningsInner.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendSchedule.md create mode 100644 rest/api/v3/mc_singlesends/docs/SinglesendSearch.md create mode 100644 rest/api/v3/mc_singlesends/docs/Status.md create mode 100644 rest/api/v3/mc_singlesends/docs/Status1.md create mode 100644 rest/api/v3/mc_singlesends/docs/Status2.md create mode 100644 rest/api/v3/mc_singlesends/docs/Status3.md create mode 100644 rest/api/v3/mc_singlesends/docs/Type.md create mode 100644 rest/api/v3/mc_singlesends/docs/UpdateSingleSend.md create mode 100644 rest/api/v3/mc_singlesends/docs/WinnerCriteria.md create mode 100644 rest/api/v3/mc_singlesends/model_ab_test_summary.go create mode 100644 rest/api/v3/mc_singlesends/model_duplicate_single_send_request.go create mode 100644 rest/api/v3/mc_singlesends/model_editor.go create mode 100644 rest/api/v3/mc_singlesends/model_editor1.go create mode 100644 rest/api/v3/mc_singlesends/model_items.go create mode 100644 rest/api/v3/mc_singlesends/model_list_category_200_response.go create mode 100644 rest/api/v3/mc_singlesends/model_list_single_send_200_response.go create mode 100644 rest/api/v3/mc_singlesends/model_list_single_send_500_response.go create mode 100644 rest/api/v3/mc_singlesends/model_list_single_send_500_response_errors_inner.go create mode 100644 rest/api/v3/mc_singlesends/model_metadata.go create mode 100644 rest/api/v3/mc_singlesends/model_schedule_single_send_201_response.go create mode 100644 rest/api/v3/mc_singlesends/model_schedule_single_send_request.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_request.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_request_email_config.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_request_send_to.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_response.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_response_email_config.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_response_send_to.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_response_short.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_response_warnings_inner.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_schedule.go create mode 100644 rest/api/v3/mc_singlesends/model_singlesend_search.go create mode 100644 rest/api/v3/mc_singlesends/model_status.go create mode 100644 rest/api/v3/mc_singlesends/model_status1.go create mode 100644 rest/api/v3/mc_singlesends/model_status2.go create mode 100644 rest/api/v3/mc_singlesends/model_status3.go create mode 100644 rest/api/v3/mc_singlesends/model_type.go create mode 100644 rest/api/v3/mc_singlesends/model_winner_criteria.go create mode 100644 rest/api/v3/mc_stats/README.md create mode 100644 rest/api/v3/mc_stats/api_export_automation_stat.go create mode 100644 rest/api/v3/mc_stats/api_export_single_send_stat.go create mode 100644 rest/api/v3/mc_stats/api_get_automation_stat.go create mode 100644 rest/api/v3/mc_stats/api_get_single_send_stat.go create mode 100644 rest/api/v3/mc_stats/api_list_automation_stat.go create mode 100644 rest/api/v3/mc_stats/api_list_click_tracking_stat.go create mode 100644 rest/api/v3/mc_stats/api_list_single_send_stat.go create mode 100644 rest/api/v3/mc_stats/api_list_single_send_tracking_stat.go create mode 100644 rest/api/v3/mc_stats/api_service.go create mode 100644 rest/api/v3/mc_stats/docs/AbPhase.md create mode 100644 rest/api/v3/mc_stats/docs/AbPhase1.md create mode 100644 rest/api/v3/mc_stats/docs/AbPhaseId.md create mode 100644 rest/api/v3/mc_stats/docs/AggregatedBy.md create mode 100644 rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponse.md create mode 100644 rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponseResultsInner.md create mode 100644 rest/api/v3/mc_stats/docs/AutomationsResponse.md create mode 100644 rest/api/v3/mc_stats/docs/AutomationsResponseResultsInner.md create mode 100644 rest/api/v3/mc_stats/docs/ErrorResponse.md create mode 100644 rest/api/v3/mc_stats/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/mc_stats/docs/ExportAutomationStat.md create mode 100644 rest/api/v3/mc_stats/docs/ExportSingleSendStat.md create mode 100644 rest/api/v3/mc_stats/docs/GetAutomationStat.md create mode 100644 rest/api/v3/mc_stats/docs/GetSingleSendStat.md create mode 100644 rest/api/v3/mc_stats/docs/Items.md create mode 100644 rest/api/v3/mc_stats/docs/Items1.md create mode 100644 rest/api/v3/mc_stats/docs/Items2.md create mode 100644 rest/api/v3/mc_stats/docs/LinkTrackingMetadata.md create mode 100644 rest/api/v3/mc_stats/docs/ListAutomationStat.md create mode 100644 rest/api/v3/mc_stats/docs/ListClickTrackingStat.md create mode 100644 rest/api/v3/mc_stats/docs/ListSingleSendStat.md create mode 100644 rest/api/v3/mc_stats/docs/ListSingleSendTrackingStat.md create mode 100644 rest/api/v3/mc_stats/docs/Metadata.md create mode 100644 rest/api/v3/mc_stats/docs/Metrics.md create mode 100644 rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponse.md create mode 100644 rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponseResultsInner.md create mode 100644 rest/api/v3/mc_stats/docs/SinglesendsResponse.md create mode 100644 rest/api/v3/mc_stats/docs/SinglesendsResponseResultsInner.md create mode 100644 rest/api/v3/mc_stats/model_ab_phase.go create mode 100644 rest/api/v3/mc_stats/model_ab_phase1.go create mode 100644 rest/api/v3/mc_stats/model_ab_phase_id.go create mode 100644 rest/api/v3/mc_stats/model_aggregated_by.go create mode 100644 rest/api/v3/mc_stats/model_autmoations_link_stats_response.go create mode 100644 rest/api/v3/mc_stats/model_autmoations_link_stats_response_results_inner.go create mode 100644 rest/api/v3/mc_stats/model_automations_response.go create mode 100644 rest/api/v3/mc_stats/model_automations_response_results_inner.go create mode 100644 rest/api/v3/mc_stats/model_error_response.go create mode 100644 rest/api/v3/mc_stats/model_error_response_errors_inner.go create mode 100644 rest/api/v3/mc_stats/model_items.go create mode 100644 rest/api/v3/mc_stats/model_items1.go create mode 100644 rest/api/v3/mc_stats/model_items2.go create mode 100644 rest/api/v3/mc_stats/model_link_tracking_metadata.go create mode 100644 rest/api/v3/mc_stats/model_metadata.go create mode 100644 rest/api/v3/mc_stats/model_metrics.go create mode 100644 rest/api/v3/mc_stats/model_singlesends_link_stats_response.go create mode 100644 rest/api/v3/mc_stats/model_singlesends_link_stats_response_results_inner.go create mode 100644 rest/api/v3/mc_stats/model_singlesends_response.go create mode 100644 rest/api/v3/mc_stats/model_singlesends_response_results_inner.go create mode 100644 rest/api/v3/mc_test/README.md create mode 100644 rest/api/v3/mc_test/api_send_test_marketing_email.go create mode 100644 rest/api/v3/mc_test/api_service.go create mode 100644 rest/api/v3/mc_test/docs/ErrorResponse.md create mode 100644 rest/api/v3/mc_test/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/mc_test/docs/SendTestMarketingEmail.md create mode 100644 rest/api/v3/mc_test/docs/SendTestMarketingEmailRequest.md create mode 100644 rest/api/v3/mc_test/model_error_response.go create mode 100644 rest/api/v3/mc_test/model_error_response_errors_inner.go create mode 100644 rest/api/v3/mc_test/model_send_test_marketing_email_request.go create mode 100644 rest/api/v3/partner/README.md create mode 100644 rest/api/v3/partner/api_list_partner_setting.go create mode 100644 rest/api/v3/partner/api_service.go create mode 100644 rest/api/v3/partner/docs/ListPartnerSetting.md create mode 100644 rest/api/v3/partner/docs/ListPartnerSetting200Response.md create mode 100644 rest/api/v3/partner/docs/ListPartnerSetting200ResponseResultInner.md create mode 100644 rest/api/v3/partner/model_list_partner_setting_200_response.go create mode 100644 rest/api/v3/partner/model_list_partner_setting_200_response_result_inner.go create mode 100644 rest/api/v3/recipients_data_erasure/README.md create mode 100644 rest/api/v3/recipients_data_erasure/api_erase_recipient_email_data.go create mode 100644 rest/api/v3/recipients_data_erasure/api_service.go create mode 100644 rest/api/v3/recipients_data_erasure/docs/EraseRecipientEmailData.md create mode 100644 rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureEraseRecipientsRequest.md create mode 100644 rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureErrorV1.md create mode 100644 rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureJobId.md create mode 100644 rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_erase_recipients_request.go create mode 100644 rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_error_v1.go create mode 100644 rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_job_id.go create mode 100644 rest/api/v3/reverse_dns/README.md create mode 100644 rest/api/v3/reverse_dns/api_delete_reverse_dns.go create mode 100644 rest/api/v3/reverse_dns/api_get_reverse_dns.go create mode 100644 rest/api/v3/reverse_dns/api_list_reverse_dns.go create mode 100644 rest/api/v3/reverse_dns/api_service.go create mode 100644 rest/api/v3/reverse_dns/api_set_up_reverse_dns.go create mode 100644 rest/api/v3/reverse_dns/api_validate_reverse_dns.go create mode 100644 rest/api/v3/reverse_dns/docs/DeleteReverseDns.md create mode 100644 rest/api/v3/reverse_dns/docs/GetReverseDns.md create mode 100644 rest/api/v3/reverse_dns/docs/ListReverseDns.md create mode 100644 rest/api/v3/reverse_dns/docs/ReverseDns.md create mode 100644 rest/api/v3/reverse_dns/docs/ReverseDnsARecord.md create mode 100644 rest/api/v3/reverse_dns/docs/ReverseDnsUsersInner.md create mode 100644 rest/api/v3/reverse_dns/docs/SetUpReverseDns.md create mode 100644 rest/api/v3/reverse_dns/docs/SetUpReverseDnsRequest.md create mode 100644 rest/api/v3/reverse_dns/docs/Valid.md create mode 100644 rest/api/v3/reverse_dns/docs/Valid1.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns200Response.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResults.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResultsARecord.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns404Response.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns404ResponseErrorsInner.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns500Response.md create mode 100644 rest/api/v3/reverse_dns/docs/ValidateReverseDns500ResponseErrorsInner.md create mode 100644 rest/api/v3/reverse_dns/model_reverse_dns.go create mode 100644 rest/api/v3/reverse_dns/model_reverse_dns_a_record.go create mode 100644 rest/api/v3/reverse_dns/model_reverse_dns_users_inner.go create mode 100644 rest/api/v3/reverse_dns/model_set_up_reverse_dns_request.go create mode 100644 rest/api/v3/reverse_dns/model_valid.go create mode 100644 rest/api/v3/reverse_dns/model_valid1.go create mode 100644 rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response.go create mode 100644 rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results.go create mode 100644 rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results_a_record.go create mode 100644 rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response.go create mode 100644 rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response_errors_inner.go create mode 100644 rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response.go create mode 100644 rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response_errors_inner.go create mode 100644 rest/api/v3/scheduled_sends/README.md create mode 100644 rest/api/v3/scheduled_sends/api_create_scheduled_send.go create mode 100644 rest/api/v3/scheduled_sends/api_delete_scheduled_send.go create mode 100644 rest/api/v3/scheduled_sends/api_get_scheduled_send.go create mode 100644 rest/api/v3/scheduled_sends/api_list_scheduled_send.go create mode 100644 rest/api/v3/scheduled_sends/api_service.go create mode 100644 rest/api/v3/scheduled_sends/api_update_scheduled_send.go create mode 100644 rest/api/v3/scheduled_sends/docs/CancelOrPauseAScheduledSendRequest.md create mode 100644 rest/api/v3/scheduled_sends/docs/CreateScheduledSend.md create mode 100644 rest/api/v3/scheduled_sends/docs/DeleteScheduledSend.md create mode 100644 rest/api/v3/scheduled_sends/docs/ErrorResponse.md create mode 100644 rest/api/v3/scheduled_sends/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/scheduled_sends/docs/GetScheduledSend.md create mode 100644 rest/api/v3/scheduled_sends/docs/ListScheduledSend.md create mode 100644 rest/api/v3/scheduled_sends/docs/MailBatchId.md create mode 100644 rest/api/v3/scheduled_sends/docs/ScheduledSendStatus.md create mode 100644 rest/api/v3/scheduled_sends/docs/Status.md create mode 100644 rest/api/v3/scheduled_sends/docs/Status1.md create mode 100644 rest/api/v3/scheduled_sends/docs/Status2.md create mode 100644 rest/api/v3/scheduled_sends/docs/UpdateScheduledSend.md create mode 100644 rest/api/v3/scheduled_sends/docs/UpdateScheduledSendRequest.md create mode 100644 rest/api/v3/scheduled_sends/model_cancel_or_pause_a_scheduled_send_request.go create mode 100644 rest/api/v3/scheduled_sends/model_error_response.go create mode 100644 rest/api/v3/scheduled_sends/model_error_response_errors_inner.go create mode 100644 rest/api/v3/scheduled_sends/model_mail_batch_id.go create mode 100644 rest/api/v3/scheduled_sends/model_scheduled_send_status.go create mode 100644 rest/api/v3/scheduled_sends/model_status.go create mode 100644 rest/api/v3/scheduled_sends/model_status1.go create mode 100644 rest/api/v3/scheduled_sends/model_status2.go create mode 100644 rest/api/v3/scheduled_sends/model_update_scheduled_send_request.go create mode 100644 rest/api/v3/scopes/README.md create mode 100644 rest/api/v3/scopes/api_approve_scope_request.go create mode 100644 rest/api/v3/scopes/api_deny_scope_request.go create mode 100644 rest/api/v3/scopes/api_list_scope.go create mode 100644 rest/api/v3/scopes/api_list_scope_request.go create mode 100644 rest/api/v3/scopes/api_service.go create mode 100644 rest/api/v3/scopes/docs/ApproveScopeRequest.md create mode 100644 rest/api/v3/scopes/docs/ApproveScopeRequest200Response.md create mode 100644 rest/api/v3/scopes/docs/DenyScopeRequest.md create mode 100644 rest/api/v3/scopes/docs/DenyScopeRequest404Response.md create mode 100644 rest/api/v3/scopes/docs/DenyScopeRequest404ResponseErrorsInner.md create mode 100644 rest/api/v3/scopes/docs/ErrorResponse.md create mode 100644 rest/api/v3/scopes/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/scopes/docs/ListScope.md create mode 100644 rest/api/v3/scopes/docs/ListScope200Response.md create mode 100644 rest/api/v3/scopes/docs/ListScope401Response.md create mode 100644 rest/api/v3/scopes/docs/ListScope401ResponseErrorsInner.md create mode 100644 rest/api/v3/scopes/docs/ListScopeRequest.md create mode 100644 rest/api/v3/scopes/docs/ListScopeRequest200ResponseInner.md create mode 100644 rest/api/v3/scopes/model_approve_scope_request_200_response.go create mode 100644 rest/api/v3/scopes/model_deny_scope_request_404_response.go create mode 100644 rest/api/v3/scopes/model_deny_scope_request_404_response_errors_inner.go create mode 100644 rest/api/v3/scopes/model_error_response.go create mode 100644 rest/api/v3/scopes/model_error_response_errors_inner.go create mode 100644 rest/api/v3/scopes/model_list_scope_200_response.go create mode 100644 rest/api/v3/scopes/model_list_scope_401_response.go create mode 100644 rest/api/v3/scopes/model_list_scope_401_response_errors_inner.go create mode 100644 rest/api/v3/scopes/model_list_scope_request_200_response_inner.go create mode 100644 rest/api/v3/seq/README.md create mode 100644 rest/api/v3/seq/api_list_engagement_quality_score.go create mode 100644 rest/api/v3/seq/api_list_subuser_engagement_quality_score.go create mode 100644 rest/api/v3/seq/api_service.go create mode 100644 rest/api/v3/seq/docs/ListEngagementQualityScore.md create mode 100644 rest/api/v3/seq/docs/ListSubuserEngagementQualityScore.md create mode 100644 rest/api/v3/seq/docs/SeqError.md create mode 100644 rest/api/v3/seq/docs/SeqMetadata.md create mode 100644 rest/api/v3/seq/docs/SeqMetadataNextParams.md create mode 100644 rest/api/v3/seq/docs/SeqMetrics.md create mode 100644 rest/api/v3/seq/docs/SeqScore.md create mode 100644 rest/api/v3/seq/model_seq_error.go create mode 100644 rest/api/v3/seq/model_seq_metadata.go create mode 100644 rest/api/v3/seq/model_seq_metadata_next_params.go create mode 100644 rest/api/v3/seq/model_seq_metrics.go create mode 100644 rest/api/v3/seq/model_seq_score.go create mode 100644 rest/api/v3/sso/README.md create mode 100644 rest/api/v3/sso/api_create_sso_certificate.go create mode 100644 rest/api/v3/sso/api_create_sso_integration.go create mode 100644 rest/api/v3/sso/api_create_sso_teammate.go create mode 100644 rest/api/v3/sso/api_delete_sso_certificate.go create mode 100644 rest/api/v3/sso/api_delete_sso_integration.go create mode 100644 rest/api/v3/sso/api_get_sso_certificate.go create mode 100644 rest/api/v3/sso/api_get_sso_integration.go create mode 100644 rest/api/v3/sso/api_list_sso_integration.go create mode 100644 rest/api/v3/sso/api_list_sso_integration_certificate.go create mode 100644 rest/api/v3/sso/api_service.go create mode 100644 rest/api/v3/sso/api_update_sso_certificate.go create mode 100644 rest/api/v3/sso/api_update_sso_integration.go create mode 100644 rest/api/v3/sso/api_update_sso_teammate.go create mode 100644 rest/api/v3/sso/docs/CreateSsoCertificate.md create mode 100644 rest/api/v3/sso/docs/CreateSsoCertificateRequest.md create mode 100644 rest/api/v3/sso/docs/CreateSsoIntegration.md create mode 100644 rest/api/v3/sso/docs/CreateSsoTeammate.md create mode 100644 rest/api/v3/sso/docs/DeleteSsoCertificate.md create mode 100644 rest/api/v3/sso/docs/DeleteSsoIntegration.md create mode 100644 rest/api/v3/sso/docs/GetSsoCertificate.md create mode 100644 rest/api/v3/sso/docs/GetSsoIntegration.md create mode 100644 rest/api/v3/sso/docs/ListSsoIntegration.md create mode 100644 rest/api/v3/sso/docs/ListSsoIntegrationCertificate.md create mode 100644 rest/api/v3/sso/docs/PatchSsoTeammates200.md create mode 100644 rest/api/v3/sso/docs/PermissionType.md create mode 100644 rest/api/v3/sso/docs/PermissionType1.md create mode 100644 rest/api/v3/sso/docs/Persona.md create mode 100644 rest/api/v3/sso/docs/PostPatchIntegrationRequest.md create mode 100644 rest/api/v3/sso/docs/PostSsoTeammates201.md create mode 100644 rest/api/v3/sso/docs/PostSsoTeammatesRequest.md create mode 100644 rest/api/v3/sso/docs/SsoCertificateBody.md create mode 100644 rest/api/v3/sso/docs/SsoErrorResponseInner.md create mode 100644 rest/api/v3/sso/docs/SsoIntegration.md create mode 100644 rest/api/v3/sso/docs/SsoTeammatesBaseRequestProps.md create mode 100644 rest/api/v3/sso/docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md create mode 100644 rest/api/v3/sso/docs/SsoTeammatesBaseResponseProps.md create mode 100644 rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponseProps.md create mode 100644 rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md create mode 100644 rest/api/v3/sso/docs/UpdateSsoCertificate.md create mode 100644 rest/api/v3/sso/docs/UpdateSsoCertificateRequest.md create mode 100644 rest/api/v3/sso/docs/UpdateSsoIntegration.md create mode 100644 rest/api/v3/sso/docs/UpdateSsoTeammate.md create mode 100644 rest/api/v3/sso/docs/UserType.md create mode 100644 rest/api/v3/sso/model_create_sso_certificate_request.go create mode 100644 rest/api/v3/sso/model_patch_sso_teammates200.go create mode 100644 rest/api/v3/sso/model_permission_type.go create mode 100644 rest/api/v3/sso/model_permission_type1.go create mode 100644 rest/api/v3/sso/model_persona.go create mode 100644 rest/api/v3/sso/model_post_patch_integration_request.go create mode 100644 rest/api/v3/sso/model_post_sso_teammates201.go create mode 100644 rest/api/v3/sso/model_post_sso_teammates_request.go create mode 100644 rest/api/v3/sso/model_sso_certificate_body.go create mode 100644 rest/api/v3/sso/model_sso_error_response_inner.go create mode 100644 rest/api/v3/sso/model_sso_integration.go create mode 100644 rest/api/v3/sso/model_sso_teammates_base_request_props.go create mode 100644 rest/api/v3/sso/model_sso_teammates_base_request_props_subuser_access_inner.go create mode 100644 rest/api/v3/sso/model_sso_teammates_base_response_props.go create mode 100644 rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props.go create mode 100644 rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go create mode 100644 rest/api/v3/sso/model_update_sso_certificate_request.go create mode 100644 rest/api/v3/sso/model_user_type.go create mode 100644 rest/api/v3/stats/README.md create mode 100644 rest/api/v3/stats/api_get_client_stat.go create mode 100644 rest/api/v3/stats/api_list_browser_stat.go create mode 100644 rest/api/v3/stats/api_list_category.go create mode 100644 rest/api/v3/stats/api_list_category_stat.go create mode 100644 rest/api/v3/stats/api_list_category_stat_sum.go create mode 100644 rest/api/v3/stats/api_list_client_stat.go create mode 100644 rest/api/v3/stats/api_list_device_stat.go create mode 100644 rest/api/v3/stats/api_list_geo_stat.go create mode 100644 rest/api/v3/stats/api_list_mailbox_provider_stat.go create mode 100644 rest/api/v3/stats/api_list_stat.go create mode 100644 rest/api/v3/stats/api_service.go create mode 100644 rest/api/v3/stats/docs/AdvancedStatsClicks.md create mode 100644 rest/api/v3/stats/docs/AdvancedStatsClicksOpens.md create mode 100644 rest/api/v3/stats/docs/AdvancedStatsMailboxProvider.md create mode 100644 rest/api/v3/stats/docs/AdvancedStatsOpens.md create mode 100644 rest/api/v3/stats/docs/AggregatedBy.md create mode 100644 rest/api/v3/stats/docs/AggregatedBy1.md create mode 100644 rest/api/v3/stats/docs/AggregatedBy2.md create mode 100644 rest/api/v3/stats/docs/AggregatedBy3.md create mode 100644 rest/api/v3/stats/docs/CategoryStats.md create mode 100644 rest/api/v3/stats/docs/CategoryStatsStatsInner.md create mode 100644 rest/api/v3/stats/docs/CategoryStatsStatsInnerMetrics.md create mode 100644 rest/api/v3/stats/docs/ClientType.md create mode 100644 rest/api/v3/stats/docs/Country.md create mode 100644 rest/api/v3/stats/docs/GetClientStat.md create mode 100644 rest/api/v3/stats/docs/ListBrowserStat.md create mode 100644 rest/api/v3/stats/docs/ListBrowserStat200ResponseInner.md create mode 100644 rest/api/v3/stats/docs/ListBrowserStat200ResponseInnerStatsInner.md create mode 100644 rest/api/v3/stats/docs/ListCategory.md create mode 100644 rest/api/v3/stats/docs/ListCategory200ResponseInner.md create mode 100644 rest/api/v3/stats/docs/ListCategory400Response.md create mode 100644 rest/api/v3/stats/docs/ListCategory400ResponseErrorsInner.md create mode 100644 rest/api/v3/stats/docs/ListCategoryStat.md create mode 100644 rest/api/v3/stats/docs/ListCategoryStatSum.md create mode 100644 rest/api/v3/stats/docs/ListClientStat.md create mode 100644 rest/api/v3/stats/docs/ListClientStat200ResponseInner.md create mode 100644 rest/api/v3/stats/docs/ListClientStat200ResponseInnerStatsInner.md create mode 100644 rest/api/v3/stats/docs/ListDeviceStat.md create mode 100644 rest/api/v3/stats/docs/ListGeoStat.md create mode 100644 rest/api/v3/stats/docs/ListGeoStat200ResponseInner.md create mode 100644 rest/api/v3/stats/docs/ListGeoStat200ResponseInnerStatsInner.md create mode 100644 rest/api/v3/stats/docs/ListMailboxProviderStat.md create mode 100644 rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInner.md create mode 100644 rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInnerStatsInner.md create mode 100644 rest/api/v3/stats/docs/ListStat.md create mode 100644 rest/api/v3/stats/docs/ListStat200ResponseInner.md create mode 100644 rest/api/v3/stats/docs/ListStat200ResponseInnerStatsInner.md create mode 100644 rest/api/v3/stats/docs/SortByDirection.md create mode 100644 rest/api/v3/stats/docs/StatsAdvancedGlobalStats.md create mode 100644 rest/api/v3/stats/model_advanced_stats_clicks.go create mode 100644 rest/api/v3/stats/model_advanced_stats_clicks_opens.go create mode 100644 rest/api/v3/stats/model_advanced_stats_mailbox_provider.go create mode 100644 rest/api/v3/stats/model_advanced_stats_opens.go create mode 100644 rest/api/v3/stats/model_aggregated_by.go create mode 100644 rest/api/v3/stats/model_aggregated_by1.go create mode 100644 rest/api/v3/stats/model_aggregated_by2.go create mode 100644 rest/api/v3/stats/model_aggregated_by3.go create mode 100644 rest/api/v3/stats/model_category_stats.go create mode 100644 rest/api/v3/stats/model_category_stats_stats_inner.go create mode 100644 rest/api/v3/stats/model_category_stats_stats_inner_metrics.go create mode 100644 rest/api/v3/stats/model_client_type.go create mode 100644 rest/api/v3/stats/model_country.go create mode 100644 rest/api/v3/stats/model_list_browser_stat_200_response_inner.go create mode 100644 rest/api/v3/stats/model_list_browser_stat_200_response_inner_stats_inner.go create mode 100644 rest/api/v3/stats/model_list_category_200_response_inner.go create mode 100644 rest/api/v3/stats/model_list_category_400_response.go create mode 100644 rest/api/v3/stats/model_list_category_400_response_errors_inner.go create mode 100644 rest/api/v3/stats/model_list_client_stat_200_response_inner.go create mode 100644 rest/api/v3/stats/model_list_client_stat_200_response_inner_stats_inner.go create mode 100644 rest/api/v3/stats/model_list_geo_stat_200_response_inner.go create mode 100644 rest/api/v3/stats/model_list_geo_stat_200_response_inner_stats_inner.go create mode 100644 rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner.go create mode 100644 rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner_stats_inner.go create mode 100644 rest/api/v3/stats/model_list_stat_200_response_inner.go create mode 100644 rest/api/v3/stats/model_list_stat_200_response_inner_stats_inner.go create mode 100644 rest/api/v3/stats/model_sort_by_direction.go create mode 100644 rest/api/v3/stats/model_stats_advanced_global_stats.go create mode 100644 rest/api/v3/subusers/README.md create mode 100644 rest/api/v3/subusers/api_create_subuser.go create mode 100644 rest/api/v3/subusers/api_delete_subuser.go create mode 100644 rest/api/v3/subusers/api_get_subuser_credit.go create mode 100644 rest/api/v3/subusers/api_list_monthly_stat.go create mode 100644 rest/api/v3/subusers/api_list_reputation.go create mode 100644 rest/api/v3/subusers/api_list_stat.go create mode 100644 rest/api/v3/subusers/api_list_stat_sum.go create mode 100644 rest/api/v3/subusers/api_list_subuser.go create mode 100644 rest/api/v3/subusers/api_list_subuser_monthly_stat.go create mode 100644 rest/api/v3/subusers/api_service.go create mode 100644 rest/api/v3/subusers/api_update_subuser.go create mode 100644 rest/api/v3/subusers/api_update_subuser_credit.go create mode 100644 rest/api/v3/subusers/api_update_subuser_ip.go create mode 100644 rest/api/v3/subusers/api_update_subuser_remaining_credit.go create mode 100644 rest/api/v3/subusers/api_update_subuser_website_access.go create mode 100644 rest/api/v3/subusers/docs/AggregatedBy.md create mode 100644 rest/api/v3/subusers/docs/CategoryStats.md create mode 100644 rest/api/v3/subusers/docs/CategoryStatsStatsInner.md create mode 100644 rest/api/v3/subusers/docs/CategoryStatsStatsInnerMetrics.md create mode 100644 rest/api/v3/subusers/docs/CreateSubuser.md create mode 100644 rest/api/v3/subusers/docs/CreateSubuserRequest.md create mode 100644 rest/api/v3/subusers/docs/DeleteSubuser.md create mode 100644 rest/api/v3/subusers/docs/ErrorResponse.md create mode 100644 rest/api/v3/subusers/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/subusers/docs/GetSubuserCredit.md create mode 100644 rest/api/v3/subusers/docs/ListMonthlyStat.md create mode 100644 rest/api/v3/subusers/docs/ListReputation.md create mode 100644 rest/api/v3/subusers/docs/ListReputation200ResponseInner.md create mode 100644 rest/api/v3/subusers/docs/ListStat.md create mode 100644 rest/api/v3/subusers/docs/ListStatSum.md create mode 100644 rest/api/v3/subusers/docs/ListSubuser.md create mode 100644 rest/api/v3/subusers/docs/ListSubuserMonthlyStat.md create mode 100644 rest/api/v3/subusers/docs/Region.md create mode 100644 rest/api/v3/subusers/docs/Region1.md create mode 100644 rest/api/v3/subusers/docs/Region2.md create mode 100644 rest/api/v3/subusers/docs/Region3.md create mode 100644 rest/api/v3/subusers/docs/ResetFrequency.md create mode 100644 rest/api/v3/subusers/docs/ResetFrequency1.md create mode 100644 rest/api/v3/subusers/docs/SortByDirection.md create mode 100644 rest/api/v3/subusers/docs/SortByDirection1.md create mode 100644 rest/api/v3/subusers/docs/SortByDirection2.md create mode 100644 rest/api/v3/subusers/docs/SortByMetric.md create mode 100644 rest/api/v3/subusers/docs/Subuser.md create mode 100644 rest/api/v3/subusers/docs/SubuserCredits.md create mode 100644 rest/api/v3/subusers/docs/SubuserCreditsRequest.md create mode 100644 rest/api/v3/subusers/docs/SubuserPost.md create mode 100644 rest/api/v3/subusers/docs/SubuserPostCreditAllocation.md create mode 100644 rest/api/v3/subusers/docs/SubuserStats.md create mode 100644 rest/api/v3/subusers/docs/SubuserStatsStatsInner.md create mode 100644 rest/api/v3/subusers/docs/SubuserStatsStatsInnerMetrics.md create mode 100644 rest/api/v3/subusers/docs/Type.md create mode 100644 rest/api/v3/subusers/docs/Type1.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuser.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserCredit.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserIp.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserIp200Response.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserRemainingCredit.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserRemainingCreditRequest.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserRequest.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccess.md create mode 100644 rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccessRequest.md create mode 100644 rest/api/v3/subusers/model_aggregated_by.go create mode 100644 rest/api/v3/subusers/model_category_stats.go create mode 100644 rest/api/v3/subusers/model_category_stats_stats_inner.go create mode 100644 rest/api/v3/subusers/model_category_stats_stats_inner_metrics.go create mode 100644 rest/api/v3/subusers/model_create_subuser_request.go create mode 100644 rest/api/v3/subusers/model_error_response.go create mode 100644 rest/api/v3/subusers/model_error_response_errors_inner.go create mode 100644 rest/api/v3/subusers/model_list_reputation_200_response_inner.go create mode 100644 rest/api/v3/subusers/model_region.go create mode 100644 rest/api/v3/subusers/model_region1.go create mode 100644 rest/api/v3/subusers/model_region2.go create mode 100644 rest/api/v3/subusers/model_region3.go create mode 100644 rest/api/v3/subusers/model_reset_frequency.go create mode 100644 rest/api/v3/subusers/model_reset_frequency1.go create mode 100644 rest/api/v3/subusers/model_sort_by_direction.go create mode 100644 rest/api/v3/subusers/model_sort_by_direction1.go create mode 100644 rest/api/v3/subusers/model_sort_by_direction2.go create mode 100644 rest/api/v3/subusers/model_sort_by_metric.go create mode 100644 rest/api/v3/subusers/model_subuser.go create mode 100644 rest/api/v3/subusers/model_subuser_credits.go create mode 100644 rest/api/v3/subusers/model_subuser_credits_request.go create mode 100644 rest/api/v3/subusers/model_subuser_post.go create mode 100644 rest/api/v3/subusers/model_subuser_post_credit_allocation.go create mode 100644 rest/api/v3/subusers/model_subuser_stats.go create mode 100644 rest/api/v3/subusers/model_subuser_stats_stats_inner.go create mode 100644 rest/api/v3/subusers/model_subuser_stats_stats_inner_metrics.go create mode 100644 rest/api/v3/subusers/model_type.go create mode 100644 rest/api/v3/subusers/model_type1.go create mode 100644 rest/api/v3/subusers/model_update_subuser_ip_200_response.go create mode 100644 rest/api/v3/subusers/model_update_subuser_remaining_credit_request.go create mode 100644 rest/api/v3/subusers/model_update_subuser_request.go create mode 100644 rest/api/v3/subusers/model_update_subuser_website_access_request.go create mode 100644 rest/api/v3/teammates/README.md create mode 100644 rest/api/v3/teammates/api_delete_pending_teammate.go create mode 100644 rest/api/v3/teammates/api_delete_teammate.go create mode 100644 rest/api/v3/teammates/api_get_teammate.go create mode 100644 rest/api/v3/teammates/api_invite_teammate.go create mode 100644 rest/api/v3/teammates/api_list_pending_teammate.go create mode 100644 rest/api/v3/teammates/api_list_subuser_by_template.go create mode 100644 rest/api/v3/teammates/api_list_teammate.go create mode 100644 rest/api/v3/teammates/api_resend_teammate_invite.go create mode 100644 rest/api/v3/teammates/api_service.go create mode 100644 rest/api/v3/teammates/api_update_teammate.go create mode 100644 rest/api/v3/teammates/docs/DeletePendingTeammate.md create mode 100644 rest/api/v3/teammates/docs/DeleteTeammate.md create mode 100644 rest/api/v3/teammates/docs/GetTeammate.md create mode 100644 rest/api/v3/teammates/docs/GetTeammate200Response.md create mode 100644 rest/api/v3/teammates/docs/InviteTeammate.md create mode 100644 rest/api/v3/teammates/docs/InviteTeammate201Response.md create mode 100644 rest/api/v3/teammates/docs/InviteTeammate400Response.md create mode 100644 rest/api/v3/teammates/docs/InviteTeammate400ResponseErrorsInner.md create mode 100644 rest/api/v3/teammates/docs/InviteTeammateRequest.md create mode 100644 rest/api/v3/teammates/docs/ListPendingTeammate.md create mode 100644 rest/api/v3/teammates/docs/ListPendingTeammate200Response.md create mode 100644 rest/api/v3/teammates/docs/ListPendingTeammate200ResponseResultInner.md create mode 100644 rest/api/v3/teammates/docs/ListSubuserByTemplate.md create mode 100644 rest/api/v3/teammates/docs/ListSubuserByTemplate200Response.md create mode 100644 rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadata.md create mode 100644 rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadataNextParams.md create mode 100644 rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseSubuserAccessInner.md create mode 100644 rest/api/v3/teammates/docs/ListSubuserByTemplate400Response.md create mode 100644 rest/api/v3/teammates/docs/ListSubuserByTemplate400ResponseErrorsInner.md create mode 100644 rest/api/v3/teammates/docs/ListTeammate.md create mode 100644 rest/api/v3/teammates/docs/ListTeammate200Response.md create mode 100644 rest/api/v3/teammates/docs/ListTeammate200ResponseResultInner.md create mode 100644 rest/api/v3/teammates/docs/PermissionType.md create mode 100644 rest/api/v3/teammates/docs/ResendTeammateInvite.md create mode 100644 rest/api/v3/teammates/docs/ResendTeammateInvite200Response.md create mode 100644 rest/api/v3/teammates/docs/UpdateTeammate.md create mode 100644 rest/api/v3/teammates/docs/UpdateTeammate200Response.md create mode 100644 rest/api/v3/teammates/docs/UpdateTeammateRequest.md create mode 100644 rest/api/v3/teammates/docs/UserType.md create mode 100644 rest/api/v3/teammates/docs/UserType1.md create mode 100644 rest/api/v3/teammates/docs/UserType2.md create mode 100644 rest/api/v3/teammates/model_get_teammate_200_response.go create mode 100644 rest/api/v3/teammates/model_invite_teammate_201_response.go create mode 100644 rest/api/v3/teammates/model_invite_teammate_400_response.go create mode 100644 rest/api/v3/teammates/model_invite_teammate_400_response_errors_inner.go create mode 100644 rest/api/v3/teammates/model_invite_teammate_request.go create mode 100644 rest/api/v3/teammates/model_list_pending_teammate_200_response.go create mode 100644 rest/api/v3/teammates/model_list_pending_teammate_200_response_result_inner.go create mode 100644 rest/api/v3/teammates/model_list_subuser_by_template_200_response.go create mode 100644 rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata.go create mode 100644 rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata_next_params.go create mode 100644 rest/api/v3/teammates/model_list_subuser_by_template_200_response_subuser_access_inner.go create mode 100644 rest/api/v3/teammates/model_list_subuser_by_template_400_response.go create mode 100644 rest/api/v3/teammates/model_list_subuser_by_template_400_response_errors_inner.go create mode 100644 rest/api/v3/teammates/model_list_teammate_200_response.go create mode 100644 rest/api/v3/teammates/model_list_teammate_200_response_result_inner.go create mode 100644 rest/api/v3/teammates/model_permission_type.go create mode 100644 rest/api/v3/teammates/model_resend_teammate_invite_200_response.go create mode 100644 rest/api/v3/teammates/model_update_teammate_200_response.go create mode 100644 rest/api/v3/teammates/model_update_teammate_request.go create mode 100644 rest/api/v3/teammates/model_user_type.go create mode 100644 rest/api/v3/teammates/model_user_type1.go create mode 100644 rest/api/v3/teammates/model_user_type2.go create mode 100644 rest/api/v3/templates/README.md create mode 100644 rest/api/v3/templates/api_activate_template_version.go create mode 100644 rest/api/v3/templates/api_create_template.go create mode 100644 rest/api/v3/templates/api_create_template_version.go create mode 100644 rest/api/v3/templates/api_delete_template.go create mode 100644 rest/api/v3/templates/api_delete_template_version.go create mode 100644 rest/api/v3/templates/api_duplicate_template.go create mode 100644 rest/api/v3/templates/api_get_template.go create mode 100644 rest/api/v3/templates/api_get_template_version.go create mode 100644 rest/api/v3/templates/api_list_template.go create mode 100644 rest/api/v3/templates/api_service.go create mode 100644 rest/api/v3/templates/api_update_template.go create mode 100644 rest/api/v3/templates/api_update_template_version.go create mode 100644 rest/api/v3/templates/docs/ActivateTemplateVersion.md create mode 100644 rest/api/v3/templates/docs/Active.md create mode 100644 rest/api/v3/templates/docs/Active1.md create mode 100644 rest/api/v3/templates/docs/CreateTemplate.md create mode 100644 rest/api/v3/templates/docs/CreateTemplateRequest.md create mode 100644 rest/api/v3/templates/docs/CreateTemplateVersion.md create mode 100644 rest/api/v3/templates/docs/DeleteTemplate.md create mode 100644 rest/api/v3/templates/docs/DeleteTemplateVersion.md create mode 100644 rest/api/v3/templates/docs/DuplicateTemplate.md create mode 100644 rest/api/v3/templates/docs/DuplicateTemplateRequest.md create mode 100644 rest/api/v3/templates/docs/Editor.md create mode 100644 rest/api/v3/templates/docs/Editor1.md create mode 100644 rest/api/v3/templates/docs/Generation.md create mode 100644 rest/api/v3/templates/docs/Generation1.md create mode 100644 rest/api/v3/templates/docs/Generations.md create mode 100644 rest/api/v3/templates/docs/GetTemplate.md create mode 100644 rest/api/v3/templates/docs/GetTemplateVersion.md create mode 100644 rest/api/v3/templates/docs/ListTemplate.md create mode 100644 rest/api/v3/templates/docs/ListTemplate200Response.md create mode 100644 rest/api/v3/templates/docs/ListTemplate400Response.md create mode 100644 rest/api/v3/templates/docs/ListTemplate400ResponseErrorsInner.md create mode 100644 rest/api/v3/templates/docs/Metadata.md create mode 100644 rest/api/v3/templates/docs/TransactionalTemplate.md create mode 100644 rest/api/v3/templates/docs/TransactionalTemplateVersionCreate.md create mode 100644 rest/api/v3/templates/docs/TransactionalTemplateVersionOutput.md create mode 100644 rest/api/v3/templates/docs/TransactionalTemplateWarning.md create mode 100644 rest/api/v3/templates/docs/TransactionalTemplatesTemplateLean.md create mode 100644 rest/api/v3/templates/docs/TransactionalTemplatesVersionOutputLean.md create mode 100644 rest/api/v3/templates/docs/UpdateTemplate.md create mode 100644 rest/api/v3/templates/docs/UpdateTemplateRequest.md create mode 100644 rest/api/v3/templates/docs/UpdateTemplateVersion.md create mode 100644 rest/api/v3/templates/model_active.go create mode 100644 rest/api/v3/templates/model_active1.go create mode 100644 rest/api/v3/templates/model_create_template_request.go create mode 100644 rest/api/v3/templates/model_duplicate_template_request.go create mode 100644 rest/api/v3/templates/model_editor.go create mode 100644 rest/api/v3/templates/model_editor1.go create mode 100644 rest/api/v3/templates/model_generation.go create mode 100644 rest/api/v3/templates/model_generation1.go create mode 100644 rest/api/v3/templates/model_generations.go create mode 100644 rest/api/v3/templates/model_list_template_200_response.go create mode 100644 rest/api/v3/templates/model_list_template_400_response.go create mode 100644 rest/api/v3/templates/model_list_template_400_response_errors_inner.go create mode 100644 rest/api/v3/templates/model_metadata.go create mode 100644 rest/api/v3/templates/model_transactional_template.go create mode 100644 rest/api/v3/templates/model_transactional_template_version_create.go create mode 100644 rest/api/v3/templates/model_transactional_template_version_output.go create mode 100644 rest/api/v3/templates/model_transactional_template_warning.go create mode 100644 rest/api/v3/templates/model_transactional_templates_template_lean.go create mode 100644 rest/api/v3/templates/model_transactional_templates_version_output_lean.go create mode 100644 rest/api/v3/templates/model_update_template_request.go create mode 100644 rest/api/v3/tracking_settings/README.md create mode 100644 rest/api/v3/tracking_settings/api_list_click_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_list_google_analytics_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_list_open_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_list_subscription_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_list_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_service.go create mode 100644 rest/api/v3/tracking_settings/api_update_click_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_update_google_analytics_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_update_open_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/api_update_subscription_tracking_setting.go create mode 100644 rest/api/v3/tracking_settings/docs/ClickTracking.md create mode 100644 rest/api/v3/tracking_settings/docs/GoogleAnalyticsSettings.md create mode 100644 rest/api/v3/tracking_settings/docs/ListClickTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/ListGoogleAnalyticsTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting200Response.md create mode 100644 rest/api/v3/tracking_settings/docs/ListSubscriptionTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/ListTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/ListTrackingSetting200Response.md create mode 100644 rest/api/v3/tracking_settings/docs/ListTrackingSetting200ResponseResultInner.md create mode 100644 rest/api/v3/tracking_settings/docs/SubscriptionTrackingSettings.md create mode 100644 rest/api/v3/tracking_settings/docs/UpdateClickTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/UpdateClickTrackingSettingRequest.md create mode 100644 rest/api/v3/tracking_settings/docs/UpdateGoogleAnalyticsTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSettingRequest.md create mode 100644 rest/api/v3/tracking_settings/docs/UpdateSubscriptionTrackingSetting.md create mode 100644 rest/api/v3/tracking_settings/model_click_tracking.go create mode 100644 rest/api/v3/tracking_settings/model_google_analytics_settings.go create mode 100644 rest/api/v3/tracking_settings/model_list_open_tracking_setting_200_response.go create mode 100644 rest/api/v3/tracking_settings/model_list_tracking_setting_200_response.go create mode 100644 rest/api/v3/tracking_settings/model_list_tracking_setting_200_response_result_inner.go create mode 100644 rest/api/v3/tracking_settings/model_subscription_tracking_settings.go create mode 100644 rest/api/v3/tracking_settings/model_update_click_tracking_setting_request.go create mode 100644 rest/api/v3/tracking_settings/model_update_open_tracking_setting_request.go create mode 100644 rest/api/v3/user/README.md create mode 100644 rest/api/v3/user/api_list_account.go create mode 100644 rest/api/v3/user/api_list_credit.go create mode 100644 rest/api/v3/user/api_list_email.go create mode 100644 rest/api/v3/user/api_list_profile.go create mode 100644 rest/api/v3/user/api_list_username.go create mode 100644 rest/api/v3/user/api_service.go create mode 100644 rest/api/v3/user/api_update_email.go create mode 100644 rest/api/v3/user/api_update_password.go create mode 100644 rest/api/v3/user/api_update_profile.go create mode 100644 rest/api/v3/user/api_update_username.go create mode 100644 rest/api/v3/user/docs/ErrorResponse.md create mode 100644 rest/api/v3/user/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/user/docs/GETUserAccountResponse.md create mode 100644 rest/api/v3/user/docs/GETUserProfileResponse.md create mode 100644 rest/api/v3/user/docs/ListAccount.md create mode 100644 rest/api/v3/user/docs/ListCredit.md create mode 100644 rest/api/v3/user/docs/ListCredit200Response.md create mode 100644 rest/api/v3/user/docs/ListEmail.md create mode 100644 rest/api/v3/user/docs/ListEmail200Response.md create mode 100644 rest/api/v3/user/docs/ListProfile.md create mode 100644 rest/api/v3/user/docs/ListUsername.md create mode 100644 rest/api/v3/user/docs/ListUsername200Response.md create mode 100644 rest/api/v3/user/docs/Type.md create mode 100644 rest/api/v3/user/docs/UpdateEmail.md create mode 100644 rest/api/v3/user/docs/UpdateEmail200Response.md create mode 100644 rest/api/v3/user/docs/UpdateEmailRequest.md create mode 100644 rest/api/v3/user/docs/UpdatePassword.md create mode 100644 rest/api/v3/user/docs/UpdatePasswordRequest.md create mode 100644 rest/api/v3/user/docs/UpdateProfile.md create mode 100644 rest/api/v3/user/docs/UpdateUsername.md create mode 100644 rest/api/v3/user/docs/UpdateUsername200Response.md create mode 100644 rest/api/v3/user/docs/UpdateUsernameRequest.md create mode 100644 rest/api/v3/user/docs/UserProfile.md create mode 100644 rest/api/v3/user/model_error_response.go create mode 100644 rest/api/v3/user/model_error_response_errors_inner.go create mode 100644 rest/api/v3/user/model_get_user_account_response.go create mode 100644 rest/api/v3/user/model_get_user_profile_response.go create mode 100644 rest/api/v3/user/model_list_credit_200_response.go create mode 100644 rest/api/v3/user/model_list_email_200_response.go create mode 100644 rest/api/v3/user/model_list_username_200_response.go create mode 100644 rest/api/v3/user/model_type.go create mode 100644 rest/api/v3/user/model_update_email_200_response.go create mode 100644 rest/api/v3/user/model_update_email_request.go create mode 100644 rest/api/v3/user/model_update_password_request.go create mode 100644 rest/api/v3/user/model_update_username_200_response.go create mode 100644 rest/api/v3/user/model_update_username_request.go create mode 100644 rest/api/v3/user/model_user_profile.go create mode 100644 rest/api/v3/verified_senders/README.md create mode 100644 rest/api/v3/verified_senders/api_create_verified_sender.go create mode 100644 rest/api/v3/verified_senders/api_delete_verified_sender.go create mode 100644 rest/api/v3/verified_senders/api_list_verified_sender.go create mode 100644 rest/api/v3/verified_senders/api_list_verified_sender_domain.go create mode 100644 rest/api/v3/verified_senders/api_list_verified_sender_steps_completed.go create mode 100644 rest/api/v3/verified_senders/api_resend_verified_sender.go create mode 100644 rest/api/v3/verified_senders/api_service.go create mode 100644 rest/api/v3/verified_senders/api_update_verified_sender.go create mode 100644 rest/api/v3/verified_senders/api_verify_sender_token.go create mode 100644 rest/api/v3/verified_senders/docs/CreateVerifiedSender.md create mode 100644 rest/api/v3/verified_senders/docs/CreateVerifiedSender400Response.md create mode 100644 rest/api/v3/verified_senders/docs/CreateVerifiedSender400ResponseErrorsInner.md create mode 100644 rest/api/v3/verified_senders/docs/DeleteVerifiedSender.md create mode 100644 rest/api/v3/verified_senders/docs/DeleteVerifiedSender403Response.md create mode 100644 rest/api/v3/verified_senders/docs/DeleteVerifiedSender403ResponseErrorsInner.md create mode 100644 rest/api/v3/verified_senders/docs/DeleteVerifiedSender404Response.md create mode 100644 rest/api/v3/verified_senders/docs/ErrorResponse.md create mode 100644 rest/api/v3/verified_senders/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSender.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSender200Response.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200Response.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200ResponseResults.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200Response.md create mode 100644 rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200ResponseResults.md create mode 100644 rest/api/v3/verified_senders/docs/ResendVerifiedSender.md create mode 100644 rest/api/v3/verified_senders/docs/UpdateVerifiedSender.md create mode 100644 rest/api/v3/verified_senders/docs/VerifiedSenderRequest.md create mode 100644 rest/api/v3/verified_senders/docs/VerifiedSenderResponse.md create mode 100644 rest/api/v3/verified_senders/docs/VerifySenderToken.md create mode 100644 rest/api/v3/verified_senders/model_create_verified_sender_400_response.go create mode 100644 rest/api/v3/verified_senders/model_create_verified_sender_400_response_errors_inner.go create mode 100644 rest/api/v3/verified_senders/model_delete_verified_sender_403_response.go create mode 100644 rest/api/v3/verified_senders/model_delete_verified_sender_403_response_errors_inner.go create mode 100644 rest/api/v3/verified_senders/model_delete_verified_sender_404_response.go create mode 100644 rest/api/v3/verified_senders/model_error_response.go create mode 100644 rest/api/v3/verified_senders/model_error_response_errors_inner.go create mode 100644 rest/api/v3/verified_senders/model_list_verified_sender_200_response.go create mode 100644 rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response.go create mode 100644 rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response_results.go create mode 100644 rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response.go create mode 100644 rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response_results.go create mode 100644 rest/api/v3/verified_senders/model_verified_sender_request.go create mode 100644 rest/api/v3/verified_senders/model_verified_sender_response.go create mode 100644 rest/api/v3/webhooks/README.md create mode 100644 rest/api/v3/webhooks/api_create_event_webhook.go create mode 100644 rest/api/v3/webhooks/api_create_parse_setting.go create mode 100644 rest/api/v3/webhooks/api_delete_event_webhook.go create mode 100644 rest/api/v3/webhooks/api_delete_parse_setting.go create mode 100644 rest/api/v3/webhooks/api_get_event_webhook.go create mode 100644 rest/api/v3/webhooks/api_get_parse_setting.go create mode 100644 rest/api/v3/webhooks/api_get_signed_event_webhook.go create mode 100644 rest/api/v3/webhooks/api_list_event_webhook.go create mode 100644 rest/api/v3/webhooks/api_list_parse_setting.go create mode 100644 rest/api/v3/webhooks/api_list_parse_static.go create mode 100644 rest/api/v3/webhooks/api_service.go create mode 100644 rest/api/v3/webhooks/api_test_event_webhook.go create mode 100644 rest/api/v3/webhooks/api_update_event_webhook.go create mode 100644 rest/api/v3/webhooks/api_update_parse_setting.go create mode 100644 rest/api/v3/webhooks/api_update_signed_event_webhook.go create mode 100644 rest/api/v3/webhooks/docs/AggregatedBy.md create mode 100644 rest/api/v3/webhooks/docs/CreateEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/CreateEventWebhook400Response.md create mode 100644 rest/api/v3/webhooks/docs/CreateEventWebhook400ResponseErrorsInner.md create mode 100644 rest/api/v3/webhooks/docs/CreateParseSetting.md create mode 100644 rest/api/v3/webhooks/docs/DeleteEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/DeleteParseSetting.md create mode 100644 rest/api/v3/webhooks/docs/ErrorResponse.md create mode 100644 rest/api/v3/webhooks/docs/ErrorResponseErrorsInner.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookAllResponse.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookBaseResponseProps.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookDateResponseProps.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookNoDatesResponse.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookOauthResponseProps.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookRequest.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookSignedResponse.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookSignedResponseProp.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookTestRequest.md create mode 100644 rest/api/v3/webhooks/docs/EventWebhookUnsignedResponse.md create mode 100644 rest/api/v3/webhooks/docs/GetEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/GetParseSetting.md create mode 100644 rest/api/v3/webhooks/docs/GetSignedEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/GetSignedEventWebhook200Response.md create mode 100644 rest/api/v3/webhooks/docs/GetSignedEventWebhook404Response.md create mode 100644 rest/api/v3/webhooks/docs/GetSignedEventWebhook404ResponseErrorsInner.md create mode 100644 rest/api/v3/webhooks/docs/ListEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/ListParseSetting.md create mode 100644 rest/api/v3/webhooks/docs/ListParseSetting200Response.md create mode 100644 rest/api/v3/webhooks/docs/ListParseStatic.md create mode 100644 rest/api/v3/webhooks/docs/ListParseStatic200ResponseInner.md create mode 100644 rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInner.md create mode 100644 rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInnerMetrics.md create mode 100644 rest/api/v3/webhooks/docs/ParseSetting.md create mode 100644 rest/api/v3/webhooks/docs/TestEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/UpdateEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/UpdateParseSetting.md create mode 100644 rest/api/v3/webhooks/docs/UpdateSignedEventWebhook.md create mode 100644 rest/api/v3/webhooks/docs/UpdateSignedEventWebhookRequest.md create mode 100644 rest/api/v3/webhooks/model_aggregated_by.go create mode 100644 rest/api/v3/webhooks/model_create_event_webhook_400_response.go create mode 100644 rest/api/v3/webhooks/model_create_event_webhook_400_response_errors_inner.go create mode 100644 rest/api/v3/webhooks/model_error_response.go create mode 100644 rest/api/v3/webhooks/model_error_response_errors_inner.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_all_response.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_base_response_props.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_date_response_props.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_no_dates_response.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_oauth_response_props.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_request.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_signed_response.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_signed_response_prop.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_test_request.go create mode 100644 rest/api/v3/webhooks/model_event_webhook_unsigned_response.go create mode 100644 rest/api/v3/webhooks/model_get_signed_event_webhook_200_response.go create mode 100644 rest/api/v3/webhooks/model_get_signed_event_webhook_404_response.go create mode 100644 rest/api/v3/webhooks/model_get_signed_event_webhook_404_response_errors_inner.go create mode 100644 rest/api/v3/webhooks/model_list_parse_setting_200_response.go create mode 100644 rest/api/v3/webhooks/model_list_parse_static_200_response_inner.go create mode 100644 rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner.go create mode 100644 rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner_metrics.go create mode 100644 rest/api/v3/webhooks/model_parse_setting.go create mode 100644 rest/api/v3/webhooks/model_update_signed_event_webhook_request.go diff --git a/.gitignore b/.gitignore index aac0e6fe..9a50edcf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ sendgrid.env .vscode prism* **/.idea/**/* +**/.openapi-generator* diff --git a/rest/api/v3/account_provisioning/README.md b/rest/api/v3/account_provisioning/README.md new file mode 100644 index 00000000..e04a232d --- /dev/null +++ b/rest/api/v3/account_provisioning/README.md @@ -0,0 +1,87 @@ +# Go API client for + +The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. + +You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.491818+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AuthenticateAccount* | [**AuthenticateAccount**](docs/AuthenticateAccount.md#authenticateaccount) | **Post** /v3/partners/accounts/{AccountID}/sso | Authenticate an account with single sign on +*CreateAccount* | [**CreateAccount**](docs/CreateAccount.md#createaccount) | **Post** /v3/partners/accounts | Create an account +*DeleteAccount* | [**DeleteAccount**](docs/DeleteAccount.md#deleteaccount) | **Delete** /v3/partners/accounts/{AccountID} | Delete an account +*GetAccountState* | [**GetAccountState**](docs/GetAccountState.md#getaccountstate) | **Get** /v3/partners/accounts/{AccountID}/state | Get an account's state +*ListAccount* | [**ListAccount**](docs/ListAccount.md#listaccount) | **Get** /v3/partners/accounts | Get all accounts +*ListAccountOffering* | [**ListAccountOffering**](docs/ListAccountOffering.md#listaccountoffering) | **Get** /v3/partners/accounts/{AccountID}/offerings | Get account offerings +*ListOffering* | [**ListOffering**](docs/ListOffering.md#listoffering) | **Get** /v3/partners/offerings | Get all available offerings +*UpdateAccountOffering* | [**UpdateAccountOffering**](docs/UpdateAccountOffering.md#updateaccountoffering) | **Put** /v3/partners/accounts/{AccountID}/offerings | Update account offerings +*UpdateAccountState* | [**UpdateAccountState**](docs/UpdateAccountState.md#updateaccountstate) | **Put** /v3/partners/accounts/{AccountID}/state | Update an account's state + + +## Documentation For Models + + - [AccountList](AccountList.md) + - [AccountProvisioningAccount](AccountProvisioningAccount.md) + - [AccountProvisioningAccountId](AccountProvisioningAccountId.md) + - [AccountProvisioningCatalog](AccountProvisioningCatalog.md) + - [AccountProvisioningOfferingList](AccountProvisioningOfferingList.md) + - [AccountProvisioningOfferingV1](AccountProvisioningOfferingV1.md) + - [AccountProvisioningPagination](AccountProvisioningPagination.md) + - [AccountProvisioningProfile](AccountProvisioningProfile.md) + - [AccountProvisioningStateRead](AccountProvisioningStateRead.md) + - [AccountProvisioningStateWrite](AccountProvisioningStateWrite.md) + - [CatalogEntry](CatalogEntry.md) + - [CatalogEntryEntitlements](CatalogEntryEntitlements.md) + - [CreateAccountParams](CreateAccountParams.md) + - [ErrorResponse](ErrorResponse.md) + - [OfferingsToAdd](OfferingsToAdd.md) + - [State](State.md) + - [State1](State1.md) + - [Type](Type.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/account_provisioning/api_authenticate_account.go b/rest/api/v3/account_provisioning/api_authenticate_account.go new file mode 100644 index 00000000..c933bcdb --- /dev/null +++ b/rest/api/v3/account_provisioning/api_authenticate_account.go @@ -0,0 +1,52 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "net/http" + "net/url" + + "strings" +) + +type AuthenticateAccountParam struct { + // Twilio SendGrid account ID + AccountID *string `json:"accountID"` +} + +func (params *AuthenticateAccountParam) SetAccountID(AccountID string) *AuthenticateAccountParam { + params.AccountID = &AccountID + return params +} + +// Authenticates and logs in a user to Twilio Sendgrid as a specific admin identity configured for SSO by partner. Any additional teammates or subusers will need to log in directly via app.sendgrid.com +func (c *ApiService) AuthenticateAccount(params *AuthenticateAccountParam) (interface{}, error) { + path := "/v3/partners/accounts/{AccountID}/sso" + if params != nil && params.AccountID != nil { + path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_create_account.go b/rest/api/v3/account_provisioning/api_create_account.go new file mode 100644 index 00000000..2057dec4 --- /dev/null +++ b/rest/api/v3/account_provisioning/api_create_account.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateAccountParam struct { + // + CreateAccountParams *CreateAccountParams `json:"CreateAccountParams"` + // **OPTIONAL** Custom request header provided ONLY for a test account + TTestAccount *string `json:"T-Test-Account,omitempty"` +} + +func (params *CreateAccountParam) SetCreateAccountParams(CreateAccountParams CreateAccountParams) *CreateAccountParam { + params.CreateAccountParams = &CreateAccountParams + return params +} +func (params *CreateAccountParam) SetTTestAccount(TTestAccount string) *CreateAccountParam { + params.TTestAccount = &TTestAccount + return params +} + +// Creates a new account, with specified offering, under the organization. +func (c *ApiService) CreateAccount(params *CreateAccountParam) (interface{}, error) { + path := "/v3/partners/accounts" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateAccountParams != nil { + b, err := json.Marshal(*params.CreateAccountParams) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.TTestAccount != nil { + headers["T-Test-Account"] = *params.TTestAccount + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &AccountProvisioningAccountId{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_delete_account.go b/rest/api/v3/account_provisioning/api_delete_account.go new file mode 100644 index 00000000..7d93af22 --- /dev/null +++ b/rest/api/v3/account_provisioning/api_delete_account.go @@ -0,0 +1,52 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "net/http" + "net/url" + + "strings" +) + +type DeleteAccountParam struct { + // Twilio SendGrid account ID + AccountID *string `json:"accountID"` +} + +func (params *DeleteAccountParam) SetAccountID(AccountID string) *DeleteAccountParam { + params.AccountID = &AccountID + return params +} + +// Delete a specific account under your organization by account ID. Note that this is an **irreversible** action that does the following: - Revokes API Keys and SSO so that the account user cannot log in or access SendGrid data. - Removes all offerings and configured SendGrid resources such as dedicated IPs. - Cancels billing effective immediately. +func (c *ApiService) DeleteAccount(params *DeleteAccountParam) (interface{}, error) { + path := "/v3/partners/accounts/{AccountID}" + if params != nil && params.AccountID != nil { + path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_get_account_state.go b/rest/api/v3/account_provisioning/api_get_account_state.go new file mode 100644 index 00000000..89b026f9 --- /dev/null +++ b/rest/api/v3/account_provisioning/api_get_account_state.go @@ -0,0 +1,61 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetAccountStateParam struct { + // Twilio SendGrid account ID + AccountID *string `json:"accountID"` +} + +func (params *GetAccountStateParam) SetAccountID(AccountID string) *GetAccountStateParam { + params.AccountID = &AccountID + return params +} + +// Retrieve the state of the specified account. +func (c *ApiService) GetAccountState(params *GetAccountStateParam) (interface{}, error) { + path := "/v3/partners/accounts/{AccountID}/state" + if params != nil && params.AccountID != nil { + path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AccountProvisioningStateRead{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_list_account.go b/rest/api/v3/account_provisioning/api_list_account.go new file mode 100644 index 00000000..5051ca78 --- /dev/null +++ b/rest/api/v3/account_provisioning/api_list_account.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListAccountParam struct { + // The last item successfully retrieved + Offset *string `json:"offset,omitempty"` + // The number of items to return + Limit *int32 `json:"limit,omitempty"` +} + +func (params *ListAccountParam) SetOffset(Offset string) *ListAccountParam { + params.Offset = &Offset + return params +} +func (params *ListAccountParam) SetLimit(Limit int32) *ListAccountParam { + params.Limit = &Limit + return params +} + +// Retrieves all accounts under the organization. +func (c *ApiService) ListAccount(params *ListAccountParam) (interface{}, error) { + path := "/v3/partners/accounts" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Offset != nil { + data.Set("offset", *params.Offset) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AccountList{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_list_account_offering.go b/rest/api/v3/account_provisioning/api_list_account_offering.go new file mode 100644 index 00000000..c810415c --- /dev/null +++ b/rest/api/v3/account_provisioning/api_list_account_offering.go @@ -0,0 +1,61 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ListAccountOfferingParam struct { + // Twilio SendGrid account ID + AccountID *string `json:"accountID"` +} + +func (params *ListAccountOfferingParam) SetAccountID(AccountID string) *ListAccountOfferingParam { + params.AccountID = &AccountID + return params +} + +// Retrieves offering information about the specified account. +func (c *ApiService) ListAccountOffering(params *ListAccountOfferingParam) (interface{}, error) { + path := "/v3/partners/accounts/{AccountID}/offerings" + if params != nil && params.AccountID != nil { + path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AccountProvisioningOfferingList{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_list_offering.go b/rest/api/v3/account_provisioning/api_list_offering.go new file mode 100644 index 00000000..40a7a358 --- /dev/null +++ b/rest/api/v3/account_provisioning/api_list_offering.go @@ -0,0 +1,49 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListOfferingParam struct { +} + +// Retrieves offerings available under the organization. +func (c *ApiService) ListOffering() (interface{}, error) { + path := "/v3/partners/offerings" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AccountProvisioningCatalog{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_service.go b/rest/api/v3/account_provisioning/api_service.go new file mode 100644 index 00000000..6459d6eb --- /dev/null +++ b/rest/api/v3/account_provisioning/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/account_provisioning/api_update_account_offering.go b/rest/api/v3/account_provisioning/api_update_account_offering.go new file mode 100644 index 00000000..fd0db615 --- /dev/null +++ b/rest/api/v3/account_provisioning/api_update_account_offering.go @@ -0,0 +1,76 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateAccountOfferingParam struct { + // Twilio SendGrid account ID + AccountID *string `json:"accountID"` + // + OfferingsToAdd *OfferingsToAdd `json:"OfferingsToAdd"` +} + +func (params *UpdateAccountOfferingParam) SetAccountID(AccountID string) *UpdateAccountOfferingParam { + params.AccountID = &AccountID + return params +} +func (params *UpdateAccountOfferingParam) SetOfferingsToAdd(OfferingsToAdd OfferingsToAdd) *UpdateAccountOfferingParam { + params.OfferingsToAdd = &OfferingsToAdd + return params +} + +// Changes a package offering for the specified account. Please note that an account can have only one package offering. Also associates one or more add-on offerings such as Marketing Campaigns, Dedicated IP Addresses, and Expert Services to the specified account. +func (c *ApiService) UpdateAccountOffering(params *UpdateAccountOfferingParam) (interface{}, error) { + path := "/v3/partners/accounts/{AccountID}/offerings" + if params != nil && params.AccountID != nil { + path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.OfferingsToAdd != nil { + b, err := json.Marshal(*params.OfferingsToAdd) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AccountProvisioningOfferingList{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/api_update_account_state.go b/rest/api/v3/account_provisioning/api_update_account_state.go new file mode 100644 index 00000000..5d9270dc --- /dev/null +++ b/rest/api/v3/account_provisioning/api_update_account_state.go @@ -0,0 +1,68 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateAccountStateParam struct { + // Twilio SendGrid account ID + AccountID *string `json:"accountID"` + // + AccountProvisioningStateWrite *AccountProvisioningStateWrite `json:"AccountProvisioningStateWrite"` +} + +func (params *UpdateAccountStateParam) SetAccountID(AccountID string) *UpdateAccountStateParam { + params.AccountID = &AccountID + return params +} +func (params *UpdateAccountStateParam) SetAccountProvisioningStateWrite(AccountProvisioningStateWrite AccountProvisioningStateWrite) *UpdateAccountStateParam { + params.AccountProvisioningStateWrite = &AccountProvisioningStateWrite + return params +} + +// Update the state of the specified account. +func (c *ApiService) UpdateAccountState(params *UpdateAccountStateParam) (interface{}, error) { + path := "/v3/partners/accounts/{AccountID}/state" + if params != nil && params.AccountID != nil { + path = strings.Replace(path, "{"+"AccountID"+"}", *params.AccountID, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AccountProvisioningStateWrite != nil { + b, err := json.Marshal(*params.AccountProvisioningStateWrite) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/account_provisioning/docs/AccountList.md b/rest/api/v3/account_provisioning/docs/AccountList.md new file mode 100644 index 00000000..8ce68222 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountList.md @@ -0,0 +1,12 @@ +# AccountList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Accounts** | [**[]AccountProvisioningAccount**](AccountProvisioningAccount.md) | List of account objects. |[optional] +**Pages** | [**AccountProvisioningPagination**](AccountProvisioningPagination.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningAccount.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningAccount.md new file mode 100644 index 00000000..acb44d9b --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningAccount.md @@ -0,0 +1,12 @@ +# AccountProvisioningAccount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Twilio SendGrid account ID | +**CreatedAt** | [**time.Time**](time.Time.md) | Timestamp indicating when the account was created. Format is [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningAccountId.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningAccountId.md new file mode 100644 index 00000000..47063845 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningAccountId.md @@ -0,0 +1,11 @@ +# AccountProvisioningAccountId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountId** | **string** | Twilio SendGrid account ID | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningCatalog.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningCatalog.md new file mode 100644 index 00000000..d0fe779b --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningCatalog.md @@ -0,0 +1,11 @@ +# AccountProvisioningCatalog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Catalog** | [**[]CatalogEntry**](CatalogEntry.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingList.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingList.md new file mode 100644 index 00000000..7bea6750 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingList.md @@ -0,0 +1,11 @@ +# AccountProvisioningOfferingList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Offerings** | [**[]AccountProvisioningOfferingV1**](AccountProvisioningOfferingV1.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingV1.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingV1.md new file mode 100644 index 00000000..d4da851a --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningOfferingV1.md @@ -0,0 +1,13 @@ +# AccountProvisioningOfferingV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of the offering | +**Type** | [**Type**](Type.md) | Defines the type of offering (e.g., package or addon). | +**Quantity** | **int64** | Quantity of the specified addon to be added. If offering type is `package`, quantity must be 1. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningPagination.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningPagination.md new file mode 100644 index 00000000..1c2e4e18 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningPagination.md @@ -0,0 +1,12 @@ +# AccountProvisioningPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Last** | **string** | The last item returned |[optional] +**Example** | Pointer to **interface{}** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningProfile.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningProfile.md new file mode 100644 index 00000000..9f5c6154 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningProfile.md @@ -0,0 +1,17 @@ +# AccountProvisioningProfile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | First name of the account holder |[optional] +**LastName** | **string** | Last name of the account holder |[optional] +**CompanyName** | **string** | Company name of the account holder |[optional] +**CompanyWebsite** | **string** | Company website of the account holder |[optional] +**Email** | **string** | Email of the account holder |[optional] +**Phone** | **string** | Phone number with a maximum of fifteen digits formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] |[optional] +**Timezone** | **string** | Area/Location as listed in the [IANA Time Zone database](https://www.iana.org/time-zones) |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningStateRead.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningStateRead.md new file mode 100644 index 00000000..8d2164df --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningStateRead.md @@ -0,0 +1,11 @@ +# AccountProvisioningStateRead + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**State** | [**State**](State.md) | The state of the account (e.g., `activated`, `deactivated`, `suspended`, `banned`, or `indeterminate`) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AccountProvisioningStateWrite.md b/rest/api/v3/account_provisioning/docs/AccountProvisioningStateWrite.md new file mode 100644 index 00000000..e0e3fdae --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AccountProvisioningStateWrite.md @@ -0,0 +1,11 @@ +# AccountProvisioningStateWrite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**State** | [**State1**](State1.md) | The state of the account (e.g., `activated`, `deactivated`) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/AuthenticateAccount.md b/rest/api/v3/account_provisioning/docs/AuthenticateAccount.md new file mode 100644 index 00000000..c4d769bc --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/AuthenticateAccount.md @@ -0,0 +1,51 @@ +# AuthenticateAccount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AuthenticateAccount**](AuthenticateAccount.md#AuthenticateAccount) | **Post** /v3/partners/accounts/{AccountID}/sso | Authenticate an account with single sign on + + + +## AuthenticateAccount + +> AuthenticateAccount(ctx, AccountID) + +Authenticate an account with single sign on + +Authenticates and logs in a user to Twilio Sendgrid as a specific admin identity configured for SSO by partner. Any additional teammates or subusers will need to log in directly via app.sendgrid.com + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AccountID** | **string** | Twilio SendGrid account ID + +### Other Parameters + +Other parameters are passed through a pointer to a AuthenticateAccountParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/CatalogEntry.md b/rest/api/v3/account_provisioning/docs/CatalogEntry.md new file mode 100644 index 00000000..b9c58b86 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/CatalogEntry.md @@ -0,0 +1,12 @@ +# CatalogEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Offering** | [**AccountProvisioningOfferingV1**](AccountProvisioningOfferingV1.md) | |[optional] +**Entitlements** | [**CatalogEntryEntitlements**](CatalogEntryEntitlements.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/CatalogEntryEntitlements.md b/rest/api/v3/account_provisioning/docs/CatalogEntryEntitlements.md new file mode 100644 index 00000000..295aba0e --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/CatalogEntryEntitlements.md @@ -0,0 +1,14 @@ +# CatalogEntryEntitlements + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EmailSendsMaxMonthly** | **int64** | Total number of email sends per month |[optional] +**IpCount** | **int64** | Number of dedicated IPs offered |[optional] +**TeammatesMaxTotal** | **int64** | Total number of teammates allowed |[optional] +**UsersMaxTotal** | **int64** | Total number of subusers allowed |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/CreateAccount.md b/rest/api/v3/account_provisioning/docs/CreateAccount.md new file mode 100644 index 00000000..ecbf0664 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/CreateAccount.md @@ -0,0 +1,48 @@ +# CreateAccount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateAccount**](CreateAccount.md#CreateAccount) | **Post** /v3/partners/accounts | Create an account + + + +## CreateAccount + +> AccountProvisioningAccountId CreateAccount(ctx, CreateAccountParamsoptional) + +Create an account + +Creates a new account, with specified offering, under the organization. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateAccountParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**TTestAccount** | **string** | **OPTIONAL** Custom request header provided ONLY for a test account + +### Return type + +[**AccountProvisioningAccountId**](AccountProvisioningAccountId.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/CreateAccountParams.md b/rest/api/v3/account_provisioning/docs/CreateAccountParams.md new file mode 100644 index 00000000..0770960f --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/CreateAccountParams.md @@ -0,0 +1,12 @@ +# CreateAccountParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Profile** | [**AccountProvisioningProfile**](AccountProvisioningProfile.md) | |[optional] +**Offerings** | [**[]AccountProvisioningOfferingV1**](AccountProvisioningOfferingV1.md) | List of offering names to assign to account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/DeleteAccount.md b/rest/api/v3/account_provisioning/docs/DeleteAccount.md new file mode 100644 index 00000000..56c25b9b --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/DeleteAccount.md @@ -0,0 +1,51 @@ +# DeleteAccount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteAccount**](DeleteAccount.md#DeleteAccount) | **Delete** /v3/partners/accounts/{AccountID} | Delete an account + + + +## DeleteAccount + +> DeleteAccount(ctx, AccountID) + +Delete an account + +Delete a specific account under your organization by account ID. Note that this is an **irreversible** action that does the following: - Revokes API Keys and SSO so that the account user cannot log in or access SendGrid data. - Removes all offerings and configured SendGrid resources such as dedicated IPs. - Cancels billing effective immediately. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AccountID** | **string** | Twilio SendGrid account ID + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteAccountParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/ErrorResponse.md b/rest/api/v3/account_provisioning/docs/ErrorResponse.md new file mode 100644 index 00000000..976ef82d --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/ErrorResponse.md @@ -0,0 +1,13 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The message representing the error from the API. | +**Field** | **string** | The field associated with the error. | +**ErrorId** | **string** | ID representing the error as a unique nubmer. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/GetAccountState.md b/rest/api/v3/account_provisioning/docs/GetAccountState.md new file mode 100644 index 00000000..72f545d0 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/GetAccountState.md @@ -0,0 +1,51 @@ +# GetAccountState + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetAccountState**](GetAccountState.md#GetAccountState) | **Get** /v3/partners/accounts/{AccountID}/state | Get an account's state + + + +## GetAccountState + +> AccountProvisioningStateRead GetAccountState(ctx, AccountID) + +Get an account's state + +Retrieve the state of the specified account. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AccountID** | **string** | Twilio SendGrid account ID + +### Other Parameters + +Other parameters are passed through a pointer to a GetAccountStateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**AccountProvisioningStateRead**](AccountProvisioningStateRead.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/ListAccount.md b/rest/api/v3/account_provisioning/docs/ListAccount.md new file mode 100644 index 00000000..08835e00 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/ListAccount.md @@ -0,0 +1,49 @@ +# ListAccount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAccount**](ListAccount.md#ListAccount) | **Get** /v3/partners/accounts | Get all accounts + + + +## ListAccount + +> AccountList ListAccount(ctx, optional) + +Get all accounts + +Retrieves all accounts under the organization. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAccountParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Offset** | **string** | The last item successfully retrieved +**Limit** | **int32** | The number of items to return + +### Return type + +[**AccountList**](AccountList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/ListAccountOffering.md b/rest/api/v3/account_provisioning/docs/ListAccountOffering.md new file mode 100644 index 00000000..dfcc05e9 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/ListAccountOffering.md @@ -0,0 +1,51 @@ +# ListAccountOffering + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAccountOffering**](ListAccountOffering.md#ListAccountOffering) | **Get** /v3/partners/accounts/{AccountID}/offerings | Get account offerings + + + +## ListAccountOffering + +> AccountProvisioningOfferingList ListAccountOffering(ctx, AccountID) + +Get account offerings + +Retrieves offering information about the specified account. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AccountID** | **string** | Twilio SendGrid account ID + +### Other Parameters + +Other parameters are passed through a pointer to a ListAccountOfferingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**AccountProvisioningOfferingList**](AccountProvisioningOfferingList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/ListOffering.md b/rest/api/v3/account_provisioning/docs/ListOffering.md new file mode 100644 index 00000000..7f8f7f4d --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/ListOffering.md @@ -0,0 +1,44 @@ +# ListOffering + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListOffering**](ListOffering.md#ListOffering) | **Get** /v3/partners/offerings | Get all available offerings + + + +## ListOffering + +> AccountProvisioningCatalog ListOffering(ctx, ) + +Get all available offerings + +Retrieves offerings available under the organization. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListOfferingParams struct + + +### Return type + +[**AccountProvisioningCatalog**](AccountProvisioningCatalog.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/OfferingsToAdd.md b/rest/api/v3/account_provisioning/docs/OfferingsToAdd.md new file mode 100644 index 00000000..331a737f --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/OfferingsToAdd.md @@ -0,0 +1,11 @@ +# OfferingsToAdd + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Offerings** | [**[]AccountProvisioningOfferingV1**](AccountProvisioningOfferingV1.md) | List of offerings to assign to account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/State.md b/rest/api/v3/account_provisioning/docs/State.md new file mode 100644 index 00000000..e6eafdea --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/State.md @@ -0,0 +1,16 @@ +# State + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ACTIVATED** | string | (value: `"activated"`) +**DEACTIVATED** | string | (value: `"deactivated"`) +**SUSPENDED** | string | (value: `"suspended"`) +**BANNED** | string | (value: `"banned"`) +**INDETERMINATE** | string | (value: `"indeterminate"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/State1.md b/rest/api/v3/account_provisioning/docs/State1.md new file mode 100644 index 00000000..ef3ce852 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/State1.md @@ -0,0 +1,13 @@ +# State1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ACTIVATED** | string | (value: `"activated"`) +**DEACTIVATED** | string | (value: `"deactivated"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/Type.md b/rest/api/v3/account_provisioning/docs/Type.md new file mode 100644 index 00000000..f07e195a --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/Type.md @@ -0,0 +1,13 @@ +# Type + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PACKAGE** | string | (value: `"package"`) +**ADDON** | string | (value: `"addon"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/account_provisioning/docs/UpdateAccountOffering.md b/rest/api/v3/account_provisioning/docs/UpdateAccountOffering.md new file mode 100644 index 00000000..2e4299a3 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/UpdateAccountOffering.md @@ -0,0 +1,51 @@ +# UpdateAccountOffering + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateAccountOffering**](UpdateAccountOffering.md#UpdateAccountOffering) | **Put** /v3/partners/accounts/{AccountID}/offerings | Update account offerings + + + +## UpdateAccountOffering + +> AccountProvisioningOfferingList UpdateAccountOffering(ctx, AccountIDOfferingsToAdd) + +Update account offerings + +Changes a package offering for the specified account. Please note that an account can have only one package offering. Also associates one or more add-on offerings such as Marketing Campaigns, Dedicated IP Addresses, and Expert Services to the specified account. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AccountID** | **string** | Twilio SendGrid account ID + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateAccountOfferingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**AccountProvisioningOfferingList**](AccountProvisioningOfferingList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/docs/UpdateAccountState.md b/rest/api/v3/account_provisioning/docs/UpdateAccountState.md new file mode 100644 index 00000000..c8a82904 --- /dev/null +++ b/rest/api/v3/account_provisioning/docs/UpdateAccountState.md @@ -0,0 +1,51 @@ +# UpdateAccountState + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateAccountState**](UpdateAccountState.md#UpdateAccountState) | **Put** /v3/partners/accounts/{AccountID}/state | Update an account's state + + + +## UpdateAccountState + +> UpdateAccountState(ctx, AccountIDAccountProvisioningStateWrite) + +Update an account's state + +Update the state of the specified account. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AccountID** | **string** | Twilio SendGrid account ID + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateAccountStateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/account_provisioning/model_account_list.go b/rest/api/v3/account_provisioning/model_account_list.go new file mode 100644 index 00000000..59f5e79d --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_list.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountList struct for AccountList +type AccountList struct { + // List of account objects. + Accounts *[]AccountProvisioningAccount `json:"accounts,omitempty"` + Pages *AccountProvisioningPagination `json:"pages,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_account.go b/rest/api/v3/account_provisioning/model_account_provisioning_account.go new file mode 100644 index 00000000..bcbe2fdb --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_account.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// AccountProvisioningAccount struct for AccountProvisioningAccount +type AccountProvisioningAccount struct { + // Twilio SendGrid account ID + Id string `json:"id"` + // Timestamp indicating when the account was created. Format is [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339) + CreatedAt time.Time `json:"created_at"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_account_id.go b/rest/api/v3/account_provisioning/model_account_provisioning_account_id.go new file mode 100644 index 00000000..c73f6222 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_account_id.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningAccountId struct for AccountProvisioningAccountId +type AccountProvisioningAccountId struct { + // Twilio SendGrid account ID + AccountId string `json:"account_id"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_catalog.go b/rest/api/v3/account_provisioning/model_account_provisioning_catalog.go new file mode 100644 index 00000000..717c1073 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_catalog.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningCatalog struct for AccountProvisioningCatalog +type AccountProvisioningCatalog struct { + Catalog *[]CatalogEntry `json:"catalog,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_offering_list.go b/rest/api/v3/account_provisioning/model_account_provisioning_offering_list.go new file mode 100644 index 00000000..2381fe06 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_offering_list.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningOfferingList struct for AccountProvisioningOfferingList +type AccountProvisioningOfferingList struct { + Offerings *[]AccountProvisioningOfferingV1 `json:"offerings,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_offering_v1.go b/rest/api/v3/account_provisioning/model_account_provisioning_offering_v1.go new file mode 100644 index 00000000..e3652f95 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_offering_v1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningOfferingV1 An offering is a package (email infrastructure) or add-on (marketing campaigns, dedicated IP addresses, EASE) that an account can acquire. Each offering has a list of entitlements that indicate the benefits the account receives from the acquisition. +type AccountProvisioningOfferingV1 struct { + // Name of the offering + Name string `json:"name"` + // Defines the type of offering (e.g., package or addon). + Type Type `json:"type"` + // Quantity of the specified addon to be added. If offering type is `package`, quantity must be 1. + Quantity *int64 `json:"quantity,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_pagination.go b/rest/api/v3/account_provisioning/model_account_provisioning_pagination.go new file mode 100644 index 00000000..a4f93bf0 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_pagination.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningPagination struct for AccountProvisioningPagination +type AccountProvisioningPagination struct { + // The last item returned + Last *string `json:"last,omitempty"` + Example *interface{} `json:"example,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_profile.go b/rest/api/v3/account_provisioning/model_account_provisioning_profile.go new file mode 100644 index 00000000..c352a637 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_profile.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningProfile struct for AccountProvisioningProfile +type AccountProvisioningProfile struct { + // First name of the account holder + FirstName *string `json:"first_name,omitempty"` + // Last name of the account holder + LastName *string `json:"last_name,omitempty"` + // Company name of the account holder + CompanyName *string `json:"company_name,omitempty"` + // Company website of the account holder + CompanyWebsite *string `json:"company_website,omitempty"` + // Email of the account holder + Email *string `json:"email,omitempty"` + // Phone number with a maximum of fifteen digits formatted using the E.164 standard consisting of [+] [country code] [subscriber number including area code] + Phone *string `json:"phone,omitempty"` + // Area/Location as listed in the [IANA Time Zone database](https://www.iana.org/time-zones) + Timezone *string `json:"timezone,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_state_read.go b/rest/api/v3/account_provisioning/model_account_provisioning_state_read.go new file mode 100644 index 00000000..84d25d48 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_state_read.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningStateRead struct for AccountProvisioningStateRead +type AccountProvisioningStateRead struct { + // The state of the account (e.g., `activated`, `deactivated`, `suspended`, `banned`, or `indeterminate`) + State State `json:"state"` +} diff --git a/rest/api/v3/account_provisioning/model_account_provisioning_state_write.go b/rest/api/v3/account_provisioning/model_account_provisioning_state_write.go new file mode 100644 index 00000000..625284be --- /dev/null +++ b/rest/api/v3/account_provisioning/model_account_provisioning_state_write.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AccountProvisioningStateWrite struct for AccountProvisioningStateWrite +type AccountProvisioningStateWrite struct { + // The state of the account (e.g., `activated`, `deactivated`) + State State1 `json:"state"` +} diff --git a/rest/api/v3/account_provisioning/model_catalog_entry.go b/rest/api/v3/account_provisioning/model_catalog_entry.go new file mode 100644 index 00000000..b488d947 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_catalog_entry.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CatalogEntry struct for CatalogEntry +type CatalogEntry struct { + Offering *AccountProvisioningOfferingV1 `json:"offering,omitempty"` + Entitlements *CatalogEntryEntitlements `json:"entitlements,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_catalog_entry_entitlements.go b/rest/api/v3/account_provisioning/model_catalog_entry_entitlements.go new file mode 100644 index 00000000..841d6738 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_catalog_entry_entitlements.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CatalogEntryEntitlements Set of entitlements the specified offering comes with +type CatalogEntryEntitlements struct { + // Total number of email sends per month + EmailSendsMaxMonthly *int64 `json:"email_sends_max_monthly,omitempty"` + // Number of dedicated IPs offered + IpCount *int64 `json:"ip_count,omitempty"` + // Total number of teammates allowed + TeammatesMaxTotal *int64 `json:"teammates_max_total,omitempty"` + // Total number of subusers allowed + UsersMaxTotal *int64 `json:"users_max_total,omitempty"` +} diff --git a/rest/api/v3/account_provisioning/model_create_account_params.go b/rest/api/v3/account_provisioning/model_create_account_params.go new file mode 100644 index 00000000..dd953c68 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_create_account_params.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateAccountParams struct for CreateAccountParams +type CreateAccountParams struct { + Profile *AccountProvisioningProfile `json:"profile,omitempty"` + // List of offering names to assign to account. + Offerings []AccountProvisioningOfferingV1 `json:"offerings"` +} diff --git a/rest/api/v3/account_provisioning/model_error_response.go b/rest/api/v3/account_provisioning/model_error_response.go new file mode 100644 index 00000000..553b37fa --- /dev/null +++ b/rest/api/v3/account_provisioning/model_error_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + // The message representing the error from the API. + Message string `json:"message"` + // The field associated with the error. + Field string `json:"field"` + // ID representing the error as a unique nubmer. + ErrorId string `json:"error_id"` +} diff --git a/rest/api/v3/account_provisioning/model_offerings_to_add.go b/rest/api/v3/account_provisioning/model_offerings_to_add.go new file mode 100644 index 00000000..8913aff0 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_offerings_to_add.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// OfferingsToAdd struct for OfferingsToAdd +type OfferingsToAdd struct { + // List of offerings to assign to account. + Offerings []AccountProvisioningOfferingV1 `json:"offerings"` +} diff --git a/rest/api/v3/account_provisioning/model_state.go b/rest/api/v3/account_provisioning/model_state.go new file mode 100644 index 00000000..b9deec05 --- /dev/null +++ b/rest/api/v3/account_provisioning/model_state.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// State the model 'State' +type State string + +// List of State +const ( + STATE_ACTIVATED State = "activated" + STATE_DEACTIVATED State = "deactivated" + STATE_SUSPENDED State = "suspended" + STATE_BANNED State = "banned" + STATE_INDETERMINATE State = "indeterminate" +) diff --git a/rest/api/v3/account_provisioning/model_state1.go b/rest/api/v3/account_provisioning/model_state1.go new file mode 100644 index 00000000..16b6afaf --- /dev/null +++ b/rest/api/v3/account_provisioning/model_state1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// State1 the model 'State1' +type State1 string + +// List of State1 +const ( + STATE1_ACTIVATED State1 = "activated" + STATE1_DEACTIVATED State1 = "deactivated" +) diff --git a/rest/api/v3/account_provisioning/model_type.go b/rest/api/v3/account_provisioning/model_type.go new file mode 100644 index 00000000..8b89c8bf --- /dev/null +++ b/rest/api/v3/account_provisioning/model_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Account Provisioning API +* The Twilio SendGrid Account Provisioning API provides a platform for Twilio SendGrid resellers to manage their customer accounts. This API is for companies that have a formal reseller partnership with Twilio SendGrid. You can access Twilio SendGrid sub-account functionality without becoming a reseller. If you require sub-account functionality, see the Twilio [SendGrid Subusers](https://docs.sendgrid.com/ui/account-and-settings/subusers) feature, which is available with [Pro and Premier plans](https://sendgrid.com/pricing/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_PACKAGE Type = "package" + TYPE_ADDON Type = "addon" +) diff --git a/rest/api/v3/alerts/README.md b/rest/api/v3/alerts/README.md new file mode 100644 index 00000000..dac97bea --- /dev/null +++ b/rest/api/v3/alerts/README.md @@ -0,0 +1,77 @@ +# Go API client for + +The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. + +For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.491895+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateAlert* | [**CreateAlert**](docs/CreateAlert.md#createalert) | **Post** /v3/alerts | Create a new Alert +*DeleteAlert* | [**DeleteAlert**](docs/DeleteAlert.md#deletealert) | **Delete** /v3/alerts/{AlertId} | Delete an alert +*GetAlert* | [**GetAlert**](docs/GetAlert.md#getalert) | **Get** /v3/alerts/{AlertId} | Retrieve a specific alert +*ListAlert* | [**ListAlert**](docs/ListAlert.md#listalert) | **Get** /v3/alerts | Retrieve all alerts +*UpdateAlert* | [**UpdateAlert**](docs/UpdateAlert.md#updatealert) | **Patch** /v3/alerts/{AlertId} | Update an alert + + +## Documentation For Models + + - [CreateAlert201Response](CreateAlert201Response.md) + - [CreateAlertRequest](CreateAlertRequest.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [GetAlert200Response](GetAlert200Response.md) + - [ListAlert200ResponseInner](ListAlert200ResponseInner.md) + - [Type](Type.md) + - [Type1](Type1.md) + - [Type2](Type2.md) + - [Type3](Type3.md) + - [UpdateAlert200Response](UpdateAlert200Response.md) + - [UpdateAlertRequest](UpdateAlertRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/alerts/api_create_alert.go b/rest/api/v3/alerts/api_create_alert.go new file mode 100644 index 00000000..c6394105 --- /dev/null +++ b/rest/api/v3/alerts/api_create_alert.go @@ -0,0 +1,82 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateAlertParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateAlertRequest *CreateAlertRequest `json:"CreateAlertRequest,omitempty"` +} + +func (params *CreateAlertParam) SetOnbehalfof(Onbehalfof string) *CreateAlertParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateAlertParam) SetCreateAlertRequest(CreateAlertRequest CreateAlertRequest) *CreateAlertParam { + params.CreateAlertRequest = &CreateAlertRequest + return params +} + +// **This endpoint allows you to create a new alert.** +func (c *ApiService) CreateAlert(params *CreateAlertParam) (interface{}, error) { + path := "/v3/alerts" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateAlertRequest != nil { + b, err := json.Marshal(*params.CreateAlertRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &CreateAlert201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/alerts/api_delete_alert.go b/rest/api/v3/alerts/api_delete_alert.go new file mode 100644 index 00000000..8fd4ccf2 --- /dev/null +++ b/rest/api/v3/alerts/api_delete_alert.go @@ -0,0 +1,62 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteAlertParam struct { + // The ID of the alert you would like to retrieve. + AlertId *int32 `json:"alert_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteAlertParam) SetAlertId(AlertId int32) *DeleteAlertParam { + params.AlertId = &AlertId + return params +} +func (params *DeleteAlertParam) SetOnbehalfof(Onbehalfof string) *DeleteAlertParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete an alert.** +func (c *ApiService) DeleteAlert(params *DeleteAlertParam) (interface{}, error) { + path := "/v3/alerts/{AlertId}" + if params != nil && params.AlertId != nil { + path = strings.Replace(path, "{"+"AlertId"+"}", fmt.Sprint(*params.AlertId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/alerts/api_get_alert.go b/rest/api/v3/alerts/api_get_alert.go new file mode 100644 index 00000000..2438b7c9 --- /dev/null +++ b/rest/api/v3/alerts/api_get_alert.go @@ -0,0 +1,71 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetAlertParam struct { + // The ID of the alert you would like to retrieve. + AlertId *int32 `json:"alert_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetAlertParam) SetAlertId(AlertId int32) *GetAlertParam { + params.AlertId = &AlertId + return params +} +func (params *GetAlertParam) SetOnbehalfof(Onbehalfof string) *GetAlertParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific alert.** +func (c *ApiService) GetAlert(params *GetAlertParam) (interface{}, error) { + path := "/v3/alerts/{AlertId}" + if params != nil && params.AlertId != nil { + path = strings.Replace(path, "{"+"AlertId"+"}", fmt.Sprint(*params.AlertId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetAlert200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/alerts/api_list_alert.go b/rest/api/v3/alerts/api_list_alert.go new file mode 100644 index 00000000..15c6a8de --- /dev/null +++ b/rest/api/v3/alerts/api_list_alert.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListAlertParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListAlertParam) SetOnbehalfof(Onbehalfof string) *ListAlertParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of your alerts.** +func (c *ApiService) ListAlert(params *ListAlertParam) (interface{}, error) { + path := "/v3/alerts" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListAlert200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/alerts/api_service.go b/rest/api/v3/alerts/api_service.go new file mode 100644 index 00000000..79301822 --- /dev/null +++ b/rest/api/v3/alerts/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/alerts/api_update_alert.go b/rest/api/v3/alerts/api_update_alert.go new file mode 100644 index 00000000..9d3ed489 --- /dev/null +++ b/rest/api/v3/alerts/api_update_alert.go @@ -0,0 +1,86 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateAlertParam struct { + // The ID of the alert you would like to retrieve. + AlertId *int32 `json:"alert_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateAlertRequest *UpdateAlertRequest `json:"UpdateAlertRequest,omitempty"` +} + +func (params *UpdateAlertParam) SetAlertId(AlertId int32) *UpdateAlertParam { + params.AlertId = &AlertId + return params +} +func (params *UpdateAlertParam) SetOnbehalfof(Onbehalfof string) *UpdateAlertParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateAlertParam) SetUpdateAlertRequest(UpdateAlertRequest UpdateAlertRequest) *UpdateAlertParam { + params.UpdateAlertRequest = &UpdateAlertRequest + return params +} + +// **This endpoint allows you to update an alert.** +func (c *ApiService) UpdateAlert(params *UpdateAlertParam) (interface{}, error) { + path := "/v3/alerts/{AlertId}" + if params != nil && params.AlertId != nil { + path = strings.Replace(path, "{"+"AlertId"+"}", fmt.Sprint(*params.AlertId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateAlertRequest != nil { + b, err := json.Marshal(*params.UpdateAlertRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateAlert200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/alerts/docs/CreateAlert.md b/rest/api/v3/alerts/docs/CreateAlert.md new file mode 100644 index 00000000..5b8a4c69 --- /dev/null +++ b/rest/api/v3/alerts/docs/CreateAlert.md @@ -0,0 +1,49 @@ +# CreateAlert + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateAlert**](CreateAlert.md#CreateAlert) | **Post** /v3/alerts | Create a new Alert + + + +## CreateAlert + +> CreateAlert201Response CreateAlert(ctx, optional) + +Create a new Alert + +**This endpoint allows you to create a new alert.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateAlertParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateAlertRequest** | [**CreateAlertRequest**](CreateAlertRequest.md) | + +### Return type + +[**CreateAlert201Response**](CreateAlert201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/alerts/docs/CreateAlert201Response.md b/rest/api/v3/alerts/docs/CreateAlert201Response.md new file mode 100644 index 00000000..8d9fce20 --- /dev/null +++ b/rest/api/v3/alerts/docs/CreateAlert201Response.md @@ -0,0 +1,17 @@ +# CreateAlert201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **int32** | A Unix timestamp indicating when the alert was created. | +**EmailTo** | **string** | The email address that the alert will be sent to. | +**Frequency** | **string** | If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example, \"daily\", \"weekly\", or \"monthly\". |[optional] +**Id** | **int32** | The ID of the alert. | +**Type** | **string** | The type of alert. | +**UpdatedAt** | **int32** | A Unix timestamp indicating when the alert was last modified. | +**Percentage** | **int32** | If the alert is of type `usage_limit`, this indicates the percentage of email usage that must be reached before the alert will be sent. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/CreateAlertRequest.md b/rest/api/v3/alerts/docs/CreateAlertRequest.md new file mode 100644 index 00000000..b043fc6a --- /dev/null +++ b/rest/api/v3/alerts/docs/CreateAlertRequest.md @@ -0,0 +1,14 @@ +# CreateAlertRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Type**](Type.md) | The type of alert you want to create. Can be either usage_limit or stats_notification. Example: usage_limit | +**EmailTo** | **string** | The email address the alert will be sent to. Example: test@example.com | +**Frequency** | **string** | Required for stats_notification. How frequently the alert will be sent. Example: daily |[optional] +**Percentage** | **int32** | Required for usage_limit. When this usage threshold is reached, the alert will be sent. Example: 90 |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/DeleteAlert.md b/rest/api/v3/alerts/docs/DeleteAlert.md new file mode 100644 index 00000000..ba62219b --- /dev/null +++ b/rest/api/v3/alerts/docs/DeleteAlert.md @@ -0,0 +1,52 @@ +# DeleteAlert + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteAlert**](DeleteAlert.md#DeleteAlert) | **Delete** /v3/alerts/{AlertId} | Delete an alert + + + +## DeleteAlert + +> DeleteAlert(ctx, AlertIdoptional) + +Delete an alert + +**This endpoint allows you to delete an alert.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AlertId** | **int32** | The ID of the alert you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteAlertParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/alerts/docs/ErrorResponse.md b/rest/api/v3/alerts/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/alerts/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/ErrorResponseErrorsInner.md b/rest/api/v3/alerts/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/alerts/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/GetAlert.md b/rest/api/v3/alerts/docs/GetAlert.md new file mode 100644 index 00000000..345075a6 --- /dev/null +++ b/rest/api/v3/alerts/docs/GetAlert.md @@ -0,0 +1,52 @@ +# GetAlert + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetAlert**](GetAlert.md#GetAlert) | **Get** /v3/alerts/{AlertId} | Retrieve a specific alert + + + +## GetAlert + +> GetAlert200Response GetAlert(ctx, AlertIdoptional) + +Retrieve a specific alert + +**This endpoint allows you to retrieve a specific alert.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AlertId** | **int32** | The ID of the alert you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetAlertParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GetAlert200Response**](GetAlert200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/alerts/docs/GetAlert200Response.md b/rest/api/v3/alerts/docs/GetAlert200Response.md new file mode 100644 index 00000000..4ea6ac01 --- /dev/null +++ b/rest/api/v3/alerts/docs/GetAlert200Response.md @@ -0,0 +1,17 @@ +# GetAlert200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **int32** | A Unix timestamp indicating when the alert was created. | +**EmailTo** | **string** | The email address that the alert will be sent to. | +**Frequency** | **string** | If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\". |[optional] +**Id** | **int32** | The ID of the alert. | +**Type** | [**Type2**](Type2.md) | The type of alert. | +**UpdatedAt** | **int32** | A Unix timestamp indicating when the alert was last modified. | +**Percentage** | **int32** | If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/ListAlert.md b/rest/api/v3/alerts/docs/ListAlert.md new file mode 100644 index 00000000..9996e4cd --- /dev/null +++ b/rest/api/v3/alerts/docs/ListAlert.md @@ -0,0 +1,48 @@ +# ListAlert + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAlert**](ListAlert.md#ListAlert) | **Get** /v3/alerts | Retrieve all alerts + + + +## ListAlert + +> []ListAlert200ResponseInner ListAlert(ctx, optional) + +Retrieve all alerts + +**This endpoint allows you to retrieve all of your alerts.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAlertParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]ListAlert200ResponseInner**](ListAlert200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/alerts/docs/ListAlert200ResponseInner.md b/rest/api/v3/alerts/docs/ListAlert200ResponseInner.md new file mode 100644 index 00000000..a078cc54 --- /dev/null +++ b/rest/api/v3/alerts/docs/ListAlert200ResponseInner.md @@ -0,0 +1,17 @@ +# ListAlert200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **int32** | A Unix timestamp indicating when the alert was created. | +**EmailTo** | **string** | The email address that the alert will be sent to. | +**Id** | **int32** | The ID of the alert. | +**Percentage** | **int32** | If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent. |[optional] +**Type** | [**Type1**](Type1.md) | The type of alert. | +**UpdatedAt** | **int32** | A Unix timestamp indicating when the alert was last modified. |[optional] +**Frequency** | **string** | If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example, \"daily\", \"weekly\", or \"monthly\". |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/Type.md b/rest/api/v3/alerts/docs/Type.md new file mode 100644 index 00000000..31653d8d --- /dev/null +++ b/rest/api/v3/alerts/docs/Type.md @@ -0,0 +1,13 @@ +# Type + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**STATS_NOTIFICATION** | string | (value: `"stats_notification"`) +**USAGE_LIMIT** | string | (value: `"usage_limit"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/Type1.md b/rest/api/v3/alerts/docs/Type1.md new file mode 100644 index 00000000..6ae1d3bf --- /dev/null +++ b/rest/api/v3/alerts/docs/Type1.md @@ -0,0 +1,13 @@ +# Type1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**USAGE_LIMIT** | string | (value: `"usage_limit"`) +**STATS_NOTIFICATION** | string | (value: `"stats_notification"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/Type2.md b/rest/api/v3/alerts/docs/Type2.md new file mode 100644 index 00000000..54da2c21 --- /dev/null +++ b/rest/api/v3/alerts/docs/Type2.md @@ -0,0 +1,13 @@ +# Type2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**USAGE_LIMIT** | string | (value: `"usage_limit"`) +**STATS_NOTIFICATION** | string | (value: `"stats_notification"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/Type3.md b/rest/api/v3/alerts/docs/Type3.md new file mode 100644 index 00000000..60187fd5 --- /dev/null +++ b/rest/api/v3/alerts/docs/Type3.md @@ -0,0 +1,13 @@ +# Type3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**USAGE_LIMIT** | string | (value: `"usage_limit"`) +**STATS_NOTIFICATION** | string | (value: `"stats_notification"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/UpdateAlert.md b/rest/api/v3/alerts/docs/UpdateAlert.md new file mode 100644 index 00000000..85acdfc3 --- /dev/null +++ b/rest/api/v3/alerts/docs/UpdateAlert.md @@ -0,0 +1,53 @@ +# UpdateAlert + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateAlert**](UpdateAlert.md#UpdateAlert) | **Patch** /v3/alerts/{AlertId} | Update an alert + + + +## UpdateAlert + +> UpdateAlert200Response UpdateAlert(ctx, AlertIdoptional) + +Update an alert + +**This endpoint allows you to update an alert.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**AlertId** | **int32** | The ID of the alert you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateAlertParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateAlertRequest** | [**UpdateAlertRequest**](UpdateAlertRequest.md) | + +### Return type + +[**UpdateAlert200Response**](UpdateAlert200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/alerts/docs/UpdateAlert200Response.md b/rest/api/v3/alerts/docs/UpdateAlert200Response.md new file mode 100644 index 00000000..49e6cfb3 --- /dev/null +++ b/rest/api/v3/alerts/docs/UpdateAlert200Response.md @@ -0,0 +1,17 @@ +# UpdateAlert200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **int32** | A Unix timestamp indicating when the alert was created. | +**EmailTo** | **string** | The email address that the alert will be sent to. | +**Frequency** | **string** | If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\". |[optional] +**Id** | **int32** | The ID of the alert. | +**Type** | [**Type3**](Type3.md) | The type of alert. | +**UpdatedAt** | **int32** | A Unix timestamp indicating when the alert was last modified. | +**Percentage** | **int32** | If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/docs/UpdateAlertRequest.md b/rest/api/v3/alerts/docs/UpdateAlertRequest.md new file mode 100644 index 00000000..1bb4d6f0 --- /dev/null +++ b/rest/api/v3/alerts/docs/UpdateAlertRequest.md @@ -0,0 +1,13 @@ +# UpdateAlertRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EmailTo** | **string** | The new email address you want your alert to be sent to. Example: test@example.com |[optional] +**Frequency** | **string** | The new frequency at which to send the stats_notification alert. Example: monthly |[optional] +**Percentage** | **int32** | The new percentage threshold at which the usage_limit alert will be sent. Example: 90 |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/alerts/model_create_alert_201_response.go b/rest/api/v3/alerts/model_create_alert_201_response.go new file mode 100644 index 00000000..7b4d5d87 --- /dev/null +++ b/rest/api/v3/alerts/model_create_alert_201_response.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateAlert201Response struct for CreateAlert201Response +type CreateAlert201Response struct { + // A Unix timestamp indicating when the alert was created. + CreatedAt int32 `json:"created_at"` + // The email address that the alert will be sent to. + EmailTo string `json:"email_to"` + // If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example, \"daily\", \"weekly\", or \"monthly\". + Frequency *string `json:"frequency,omitempty"` + // The ID of the alert. + Id int32 `json:"id"` + // The type of alert. + Type string `json:"type"` + // A Unix timestamp indicating when the alert was last modified. + UpdatedAt int32 `json:"updated_at"` + // If the alert is of type `usage_limit`, this indicates the percentage of email usage that must be reached before the alert will be sent. + Percentage *int32 `json:"percentage,omitempty"` +} diff --git a/rest/api/v3/alerts/model_create_alert_request.go b/rest/api/v3/alerts/model_create_alert_request.go new file mode 100644 index 00000000..a741cf0f --- /dev/null +++ b/rest/api/v3/alerts/model_create_alert_request.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateAlertRequest struct for CreateAlertRequest +type CreateAlertRequest struct { + // The type of alert you want to create. Can be either usage_limit or stats_notification. Example: usage_limit + Type Type `json:"type"` + // The email address the alert will be sent to. Example: test@example.com + EmailTo string `json:"email_to"` + // Required for stats_notification. How frequently the alert will be sent. Example: daily + Frequency *string `json:"frequency,omitempty"` + // Required for usage_limit. When this usage threshold is reached, the alert will be sent. Example: 90 + Percentage *int32 `json:"percentage,omitempty"` +} diff --git a/rest/api/v3/alerts/model_error_response.go b/rest/api/v3/alerts/model_error_response.go new file mode 100644 index 00000000..98b54223 --- /dev/null +++ b/rest/api/v3/alerts/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/alerts/model_error_response_errors_inner.go b/rest/api/v3/alerts/model_error_response_errors_inner.go new file mode 100644 index 00000000..2cbef824 --- /dev/null +++ b/rest/api/v3/alerts/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/alerts/model_get_alert_200_response.go b/rest/api/v3/alerts/model_get_alert_200_response.go new file mode 100644 index 00000000..bc0595ff --- /dev/null +++ b/rest/api/v3/alerts/model_get_alert_200_response.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetAlert200Response struct for GetAlert200Response +type GetAlert200Response struct { + // A Unix timestamp indicating when the alert was created. + CreatedAt int32 `json:"created_at"` + // The email address that the alert will be sent to. + EmailTo string `json:"email_to"` + // If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\". + Frequency *string `json:"frequency,omitempty"` + // The ID of the alert. + Id int32 `json:"id"` + // The type of alert. + Type Type2 `json:"type"` + // A Unix timestamp indicating when the alert was last modified. + UpdatedAt int32 `json:"updated_at"` + // If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent. + Percentage *int32 `json:"percentage,omitempty"` +} diff --git a/rest/api/v3/alerts/model_list_alert_200_response_inner.go b/rest/api/v3/alerts/model_list_alert_200_response_inner.go new file mode 100644 index 00000000..06751c6c --- /dev/null +++ b/rest/api/v3/alerts/model_list_alert_200_response_inner.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAlert200ResponseInner struct for ListAlert200ResponseInner +type ListAlert200ResponseInner struct { + // A Unix timestamp indicating when the alert was created. + CreatedAt int32 `json:"created_at"` + // The email address that the alert will be sent to. + EmailTo string `json:"email_to"` + // The ID of the alert. + Id int32 `json:"id"` + // If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent. + Percentage *int32 `json:"percentage,omitempty"` + // The type of alert. + Type Type1 `json:"type"` + // A Unix timestamp indicating when the alert was last modified. + UpdatedAt *int32 `json:"updated_at,omitempty"` + // If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example, \"daily\", \"weekly\", or \"monthly\". + Frequency *string `json:"frequency,omitempty"` +} diff --git a/rest/api/v3/alerts/model_type.go b/rest/api/v3/alerts/model_type.go new file mode 100644 index 00000000..83d8da9f --- /dev/null +++ b/rest/api/v3/alerts/model_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_STATS_NOTIFICATION Type = "stats_notification" + TYPE_USAGE_LIMIT Type = "usage_limit" +) diff --git a/rest/api/v3/alerts/model_type1.go b/rest/api/v3/alerts/model_type1.go new file mode 100644 index 00000000..1c9bb449 --- /dev/null +++ b/rest/api/v3/alerts/model_type1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type1 the model 'Type1' +type Type1 string + +// List of Type1 +const ( + TYPE1_USAGE_LIMIT Type1 = "usage_limit" + TYPE1_STATS_NOTIFICATION Type1 = "stats_notification" +) diff --git a/rest/api/v3/alerts/model_type2.go b/rest/api/v3/alerts/model_type2.go new file mode 100644 index 00000000..27b77da8 --- /dev/null +++ b/rest/api/v3/alerts/model_type2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type2 the model 'Type2' +type Type2 string + +// List of Type2 +const ( + TYPE2_USAGE_LIMIT Type2 = "usage_limit" + TYPE2_STATS_NOTIFICATION Type2 = "stats_notification" +) diff --git a/rest/api/v3/alerts/model_type3.go b/rest/api/v3/alerts/model_type3.go new file mode 100644 index 00000000..25e96e17 --- /dev/null +++ b/rest/api/v3/alerts/model_type3.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type3 the model 'Type3' +type Type3 string + +// List of Type3 +const ( + TYPE3_USAGE_LIMIT Type3 = "usage_limit" + TYPE3_STATS_NOTIFICATION Type3 = "stats_notification" +) diff --git a/rest/api/v3/alerts/model_update_alert_200_response.go b/rest/api/v3/alerts/model_update_alert_200_response.go new file mode 100644 index 00000000..da9d6c62 --- /dev/null +++ b/rest/api/v3/alerts/model_update_alert_200_response.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateAlert200Response struct for UpdateAlert200Response +type UpdateAlert200Response struct { + // A Unix timestamp indicating when the alert was created. + CreatedAt int32 `json:"created_at"` + // The email address that the alert will be sent to. + EmailTo string `json:"email_to"` + // If the alert is of type stats_notification, this indicates how frequently the stats notifications will be sent. For example: \"daily\", \"weekly\", or \"monthly\". + Frequency *string `json:"frequency,omitempty"` + // The ID of the alert. + Id int32 `json:"id"` + // The type of alert. + Type Type3 `json:"type"` + // A Unix timestamp indicating when the alert was last modified. + UpdatedAt int32 `json:"updated_at"` + // If the alert is of type usage_limit, this indicates the percentage of email usage that must be reached before the alert will be sent. + Percentage *int32 `json:"percentage,omitempty"` +} diff --git a/rest/api/v3/alerts/model_update_alert_request.go b/rest/api/v3/alerts/model_update_alert_request.go new file mode 100644 index 00000000..3573cc14 --- /dev/null +++ b/rest/api/v3/alerts/model_update_alert_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Alerts API +* The Twilio SendGrid Alerts API allows you to specify an email address to receive notifications regarding your email usage or statistics. You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateAlertRequest struct for UpdateAlertRequest +type UpdateAlertRequest struct { + // The new email address you want your alert to be sent to. Example: test@example.com + EmailTo *string `json:"email_to,omitempty"` + // The new frequency at which to send the stats_notification alert. Example: monthly + Frequency *string `json:"frequency,omitempty"` + // The new percentage threshold at which the usage_limit alert will be sent. Example: 90 + Percentage *int32 `json:"percentage,omitempty"` +} diff --git a/rest/api/v3/api_keys/README.md b/rest/api/v3/api_keys/README.md new file mode 100644 index 00000000..010e8385 --- /dev/null +++ b/rest/api/v3/api_keys/README.md @@ -0,0 +1,76 @@ +# Go API client for + +The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. + +To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.492228+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateApiKey* | [**CreateApiKey**](docs/CreateApiKey.md#createapikey) | **Post** /v3/api_keys | Create API keys +*DeleteApiKey* | [**DeleteApiKey**](docs/DeleteApiKey.md#deleteapikey) | **Delete** /v3/api_keys/{ApiKeyId} | Delete API keys +*GetApiKey* | [**GetApiKey**](docs/GetApiKey.md#getapikey) | **Get** /v3/api_keys/{ApiKeyId} | Retrieve an existing API Key +*ListApiKey* | [**ListApiKey**](docs/ListApiKey.md#listapikey) | **Get** /v3/api_keys | Retrieve all API Keys belonging to the authenticated user +*UpdateApiKey* | [**UpdateApiKey**](docs/UpdateApiKey.md#updateapikey) | **Put** /v3/api_keys/{ApiKeyId} | Update API key name and scopes +*UpdateApiKeyName* | [**UpdateApiKeyName**](docs/UpdateApiKeyName.md#updateapikeyname) | **Patch** /v3/api_keys/{ApiKeyId} | Update API key name + + +## Documentation For Models + + - [ApiKeyResponse](ApiKeyResponse.md) + - [ApiKeyScopesResponse](ApiKeyScopesResponse.md) + - [CreateApiKey201Response](CreateApiKey201Response.md) + - [CreateApiKeyRequest](CreateApiKeyRequest.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [GetApiKey200Response](GetApiKey200Response.md) + - [ListApiKey200Response](ListApiKey200Response.md) + - [UpdateApiKeyNameRequest](UpdateApiKeyNameRequest.md) + - [UpdateApiKeyRequest](UpdateApiKeyRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/api_keys/api_create_api_key.go b/rest/api/v3/api_keys/api_create_api_key.go new file mode 100644 index 00000000..df1356fe --- /dev/null +++ b/rest/api/v3/api_keys/api_create_api_key.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateApiKeyParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateApiKeyRequest *CreateApiKeyRequest `json:"CreateApiKeyRequest,omitempty"` +} + +func (params *CreateApiKeyParam) SetOnbehalfof(Onbehalfof string) *CreateApiKeyParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateApiKeyParam) SetCreateApiKeyRequest(CreateApiKeyRequest CreateApiKeyRequest) *CreateApiKeyParam { + params.CreateApiKeyRequest = &CreateApiKeyRequest + return params +} + +// **This endpoint allows you to create a new API Key for the user.** To create your initial SendGrid API Key, you should [use the SendGrid App](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. A JSON request body containing a `name` property is required when making requests to this endpoint. If the number of maximum keys, 100, is reached, a `403` status will be returned. Though the `name` field is required, it does not need to be unique. A unique API key ID will be generated for each key you create and returned in the response body. It is not necessary to pass a `scopes` field to the API when creating a key, but you should be aware that omitting the `scopes` field from your request will create a key with \"Full Access\" permissions by default. See the [API Key Permissions List](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization) for all available scopes. An API key's scopes can be updated after creation using the \"Update API keys\" endpoint. +func (c *ApiService) CreateApiKey(params *CreateApiKeyParam) (interface{}, error) { + path := "/v3/api_keys" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateApiKeyRequest != nil { + b, err := json.Marshal(*params.CreateApiKeyRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &CreateApiKey201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/api_keys/api_delete_api_key.go b/rest/api/v3/api_keys/api_delete_api_key.go new file mode 100644 index 00000000..c4751cf3 --- /dev/null +++ b/rest/api/v3/api_keys/api_delete_api_key.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteApiKeyParam struct { + // + ApiKeyId *string `json:"api_key_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteApiKeyParam) SetApiKeyId(ApiKeyId string) *DeleteApiKeyParam { + params.ApiKeyId = &ApiKeyId + return params +} +func (params *DeleteApiKeyParam) SetOnbehalfof(Onbehalfof string) *DeleteApiKeyParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to revoke an existing API Key using an `api_key_id`** Authentications using a revoked API Key will fail after after some small propogation delay. If the API Key ID does not exist, a `404` status will be returned. +func (c *ApiService) DeleteApiKey(params *DeleteApiKeyParam) (interface{}, error) { + path := "/v3/api_keys/{ApiKeyId}" + if params != nil && params.ApiKeyId != nil { + path = strings.Replace(path, "{"+"ApiKeyId"+"}", *params.ApiKeyId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/api_keys/api_get_api_key.go b/rest/api/v3/api_keys/api_get_api_key.go new file mode 100644 index 00000000..38922161 --- /dev/null +++ b/rest/api/v3/api_keys/api_get_api_key.go @@ -0,0 +1,102 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetApiKeyParam struct { + // + ApiKeyId *string `json:"api_key_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetApiKeyParam) SetApiKeyId(ApiKeyId string) *GetApiKeyParam { + params.ApiKeyId = &ApiKeyId + return params +} +func (params *GetApiKeyParam) SetOnbehalfof(Onbehalfof string) *GetApiKeyParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a single API key using an `api_key_id`.** The endpoint will return a key's name, ID, and scopes. If the API Key ID does not, exist a `404` status will be returned. See the [API Key Permissions List](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization) for all available scopes. An API key's scopes can be updated after creation using the \"Update API keys\" endpoint. +func (c *ApiService) GetApiKey(params *GetApiKeyParam) (interface{}, error) { + path := "/v3/api_keys/{ApiKeyId}" + if params != nil && params.ApiKeyId != nil { + path = strings.Replace(path, "{"+"ApiKeyId"+"}", *params.ApiKeyId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetApiKey200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/api_keys/api_list_api_key.go b/rest/api/v3/api_keys/api_list_api_key.go new file mode 100644 index 00000000..6e4b719a --- /dev/null +++ b/rest/api/v3/api_keys/api_list_api_key.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListApiKeyParam struct { + // + Limit *int32 `json:"limit,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListApiKeyParam) SetLimit(Limit int32) *ListApiKeyParam { + params.Limit = &Limit + return params +} +func (params *ListApiKeyParam) SetOnbehalfof(Onbehalfof string) *ListApiKeyParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all API Keys that belong to the authenticated user.** A successful response from this API will include all available API keys' names and IDs. For security reasons, there is not a way to retrieve the key itself after it's created. If you lose your API key, you must create a new one. Only the \"Create API keys\" endpoint will return a key to you and only at the time of creation. An `api_key_id` can be used to update or delete the key, as well as retrieve the key's details, such as its scopes. +func (c *ApiService) ListApiKey(params *ListApiKeyParam) (interface{}, error) { + path := "/v3/api_keys" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListApiKey200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/api_keys/api_service.go b/rest/api/v3/api_keys/api_service.go new file mode 100644 index 00000000..24d94ab9 --- /dev/null +++ b/rest/api/v3/api_keys/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/api_keys/api_update_api_key.go b/rest/api/v3/api_keys/api_update_api_key.go new file mode 100644 index 00000000..c256950a --- /dev/null +++ b/rest/api/v3/api_keys/api_update_api_key.go @@ -0,0 +1,117 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateApiKeyParam struct { + // + ApiKeyId *string `json:"api_key_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateApiKeyRequest *UpdateApiKeyRequest `json:"UpdateApiKeyRequest,omitempty"` +} + +func (params *UpdateApiKeyParam) SetApiKeyId(ApiKeyId string) *UpdateApiKeyParam { + params.ApiKeyId = &ApiKeyId + return params +} +func (params *UpdateApiKeyParam) SetOnbehalfof(Onbehalfof string) *UpdateApiKeyParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateApiKeyParam) SetUpdateApiKeyRequest(UpdateApiKeyRequest UpdateApiKeyRequest) *UpdateApiKeyParam { + params.UpdateApiKeyRequest = &UpdateApiKeyRequest + return params +} + +// **This endpoint allows you to update the name and scopes of a given API key.** You must pass this endpoint a JSON request body with a `name` field and a `scopes` array containing at least one scope. The `name` and `scopes` fields will be used to update the key associated with the `api_key_id` in the request URL. If you need to update a key's scopes only, pass the `name` field with the key's existing name; the `name` will not be modified. If you need to update a key's name only, use the \"Update API key name\" endpoint. See the [API Key Permissions List](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization) for all available scopes. +func (c *ApiService) UpdateApiKey(params *UpdateApiKeyParam) (interface{}, error) { + path := "/v3/api_keys/{ApiKeyId}" + if params != nil && params.ApiKeyId != nil { + path = strings.Replace(path, "{"+"ApiKeyId"+"}", *params.ApiKeyId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateApiKeyRequest != nil { + b, err := json.Marshal(*params.UpdateApiKeyRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ApiKeyResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/api_keys/api_update_api_key_name.go b/rest/api/v3/api_keys/api_update_api_key_name.go new file mode 100644 index 00000000..e641c58e --- /dev/null +++ b/rest/api/v3/api_keys/api_update_api_key_name.go @@ -0,0 +1,117 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateApiKeyNameParam struct { + // + ApiKeyId *string `json:"api_key_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateApiKeyNameRequest *UpdateApiKeyNameRequest `json:"UpdateApiKeyNameRequest,omitempty"` +} + +func (params *UpdateApiKeyNameParam) SetApiKeyId(ApiKeyId string) *UpdateApiKeyNameParam { + params.ApiKeyId = &ApiKeyId + return params +} +func (params *UpdateApiKeyNameParam) SetOnbehalfof(Onbehalfof string) *UpdateApiKeyNameParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateApiKeyNameParam) SetUpdateApiKeyNameRequest(UpdateApiKeyNameRequest UpdateApiKeyNameRequest) *UpdateApiKeyNameParam { + params.UpdateApiKeyNameRequest = &UpdateApiKeyNameRequest + return params +} + +// **This endpoint allows you to update the name of an existing API Key.** You must pass this endpoint a JSON request body with a `name` property, which will be used to rename the key associated with the `api_key_id` passed in the URL. +func (c *ApiService) UpdateApiKeyName(params *UpdateApiKeyNameParam) (interface{}, error) { + path := "/v3/api_keys/{ApiKeyId}" + if params != nil && params.ApiKeyId != nil { + path = strings.Replace(path, "{"+"ApiKeyId"+"}", *params.ApiKeyId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateApiKeyNameRequest != nil { + b, err := json.Marshal(*params.UpdateApiKeyNameRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ApiKeyResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/api_keys/docs/ApiKeyResponse.md b/rest/api/v3/api_keys/docs/ApiKeyResponse.md new file mode 100644 index 00000000..2a77ce3f --- /dev/null +++ b/rest/api/v3/api_keys/docs/ApiKeyResponse.md @@ -0,0 +1,12 @@ +# ApiKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApiKeyId** | **string** | The ID of your API Key. |[optional] +**Name** | **string** | The name of your API Key. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/ApiKeyScopesResponse.md b/rest/api/v3/api_keys/docs/ApiKeyScopesResponse.md new file mode 100644 index 00000000..1e853c9b --- /dev/null +++ b/rest/api/v3/api_keys/docs/ApiKeyScopesResponse.md @@ -0,0 +1,13 @@ +# ApiKeyScopesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Scopes** | **[]string** | The permissions this API Key has access to. |[optional] +**ApiKeyId** | **string** | The ID of your API Key. |[optional] +**Name** | **string** | The name of your API Key. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/CreateApiKey.md b/rest/api/v3/api_keys/docs/CreateApiKey.md new file mode 100644 index 00000000..a51a16ca --- /dev/null +++ b/rest/api/v3/api_keys/docs/CreateApiKey.md @@ -0,0 +1,49 @@ +# CreateApiKey + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateApiKey**](CreateApiKey.md#CreateApiKey) | **Post** /v3/api_keys | Create API keys + + + +## CreateApiKey + +> CreateApiKey201Response CreateApiKey(ctx, optional) + +Create API keys + +**This endpoint allows you to create a new API Key for the user.** To create your initial SendGrid API Key, you should [use the SendGrid App](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. A JSON request body containing a `name` property is required when making requests to this endpoint. If the number of maximum keys, 100, is reached, a `403` status will be returned. Though the `name` field is required, it does not need to be unique. A unique API key ID will be generated for each key you create and returned in the response body. It is not necessary to pass a `scopes` field to the API when creating a key, but you should be aware that omitting the `scopes` field from your request will create a key with \"Full Access\" permissions by default. See the [API Key Permissions List](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization) for all available scopes. An API key's scopes can be updated after creation using the \"Update API keys\" endpoint. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateApiKeyParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateApiKeyRequest** | [**CreateApiKeyRequest**](CreateApiKeyRequest.md) | + +### Return type + +[**CreateApiKey201Response**](CreateApiKey201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/api_keys/docs/CreateApiKey201Response.md b/rest/api/v3/api_keys/docs/CreateApiKey201Response.md new file mode 100644 index 00000000..e0b7aa07 --- /dev/null +++ b/rest/api/v3/api_keys/docs/CreateApiKey201Response.md @@ -0,0 +1,14 @@ +# CreateApiKey201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApiKey** | **string** | |[optional] +**ApiKeyId** | **string** | |[optional] +**Name** | **string** | |[optional] +**Scopes** | **[]string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/CreateApiKeyRequest.md b/rest/api/v3/api_keys/docs/CreateApiKeyRequest.md new file mode 100644 index 00000000..e9ef1a2c --- /dev/null +++ b/rest/api/v3/api_keys/docs/CreateApiKeyRequest.md @@ -0,0 +1,12 @@ +# CreateApiKeyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name you will use to describe this API Key. | +**Scopes** | **[]string** | The individual permissions that you are giving to this API Key. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/DeleteApiKey.md b/rest/api/v3/api_keys/docs/DeleteApiKey.md new file mode 100644 index 00000000..4a144d28 --- /dev/null +++ b/rest/api/v3/api_keys/docs/DeleteApiKey.md @@ -0,0 +1,52 @@ +# DeleteApiKey + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteApiKey**](DeleteApiKey.md#DeleteApiKey) | **Delete** /v3/api_keys/{ApiKeyId} | Delete API keys + + + +## DeleteApiKey + +> DeleteApiKey(ctx, ApiKeyIdoptional) + +Delete API keys + +**This endpoint allows you to revoke an existing API Key using an `api_key_id`** Authentications using a revoked API Key will fail after after some small propogation delay. If the API Key ID does not exist, a `404` status will be returned. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ApiKeyId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteApiKeyParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/api_keys/docs/ErrorResponse.md b/rest/api/v3/api_keys/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/api_keys/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/ErrorResponseErrorsInner.md b/rest/api/v3/api_keys/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/api_keys/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/GetApiKey.md b/rest/api/v3/api_keys/docs/GetApiKey.md new file mode 100644 index 00000000..053b02e9 --- /dev/null +++ b/rest/api/v3/api_keys/docs/GetApiKey.md @@ -0,0 +1,52 @@ +# GetApiKey + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetApiKey**](GetApiKey.md#GetApiKey) | **Get** /v3/api_keys/{ApiKeyId} | Retrieve an existing API Key + + + +## GetApiKey + +> GetApiKey200Response GetApiKey(ctx, ApiKeyIdoptional) + +Retrieve an existing API Key + +**This endpoint allows you to retrieve a single API key using an `api_key_id`.** The endpoint will return a key's name, ID, and scopes. If the API Key ID does not, exist a `404` status will be returned. See the [API Key Permissions List](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization) for all available scopes. An API key's scopes can be updated after creation using the \"Update API keys\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ApiKeyId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetApiKeyParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GetApiKey200Response**](GetApiKey200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/api_keys/docs/GetApiKey200Response.md b/rest/api/v3/api_keys/docs/GetApiKey200Response.md new file mode 100644 index 00000000..43bebd71 --- /dev/null +++ b/rest/api/v3/api_keys/docs/GetApiKey200Response.md @@ -0,0 +1,11 @@ +# GetApiKey200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ApiKeyScopesResponse**](ApiKeyScopesResponse.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/ListApiKey.md b/rest/api/v3/api_keys/docs/ListApiKey.md new file mode 100644 index 00000000..5fd1de6d --- /dev/null +++ b/rest/api/v3/api_keys/docs/ListApiKey.md @@ -0,0 +1,49 @@ +# ListApiKey + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListApiKey**](ListApiKey.md#ListApiKey) | **Get** /v3/api_keys | Retrieve all API Keys belonging to the authenticated user + + + +## ListApiKey + +> ListApiKey200Response ListApiKey(ctx, optional) + +Retrieve all API Keys belonging to the authenticated user + +**This endpoint allows you to retrieve all API Keys that belong to the authenticated user.** A successful response from this API will include all available API keys' names and IDs. For security reasons, there is not a way to retrieve the key itself after it's created. If you lose your API key, you must create a new one. Only the \"Create API keys\" endpoint will return a key to you and only at the time of creation. An `api_key_id` can be used to update or delete the key, as well as retrieve the key's details, such as its scopes. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListApiKeyParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListApiKey200Response**](ListApiKey200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/api_keys/docs/ListApiKey200Response.md b/rest/api/v3/api_keys/docs/ListApiKey200Response.md new file mode 100644 index 00000000..66bb5c12 --- /dev/null +++ b/rest/api/v3/api_keys/docs/ListApiKey200Response.md @@ -0,0 +1,11 @@ +# ListApiKey200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ApiKeyResponse**](ApiKeyResponse.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/UpdateApiKey.md b/rest/api/v3/api_keys/docs/UpdateApiKey.md new file mode 100644 index 00000000..c763c8ac --- /dev/null +++ b/rest/api/v3/api_keys/docs/UpdateApiKey.md @@ -0,0 +1,53 @@ +# UpdateApiKey + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateApiKey**](UpdateApiKey.md#UpdateApiKey) | **Put** /v3/api_keys/{ApiKeyId} | Update API key name and scopes + + + +## UpdateApiKey + +> ApiKeyResponse UpdateApiKey(ctx, ApiKeyIdoptional) + +Update API key name and scopes + +**This endpoint allows you to update the name and scopes of a given API key.** You must pass this endpoint a JSON request body with a `name` field and a `scopes` array containing at least one scope. The `name` and `scopes` fields will be used to update the key associated with the `api_key_id` in the request URL. If you need to update a key's scopes only, pass the `name` field with the key's existing name; the `name` will not be modified. If you need to update a key's name only, use the \"Update API key name\" endpoint. See the [API Key Permissions List](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization) for all available scopes. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ApiKeyId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateApiKeyParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateApiKeyRequest** | [**UpdateApiKeyRequest**](UpdateApiKeyRequest.md) | + +### Return type + +[**ApiKeyResponse**](ApiKeyResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/api_keys/docs/UpdateApiKeyName.md b/rest/api/v3/api_keys/docs/UpdateApiKeyName.md new file mode 100644 index 00000000..84379fe3 --- /dev/null +++ b/rest/api/v3/api_keys/docs/UpdateApiKeyName.md @@ -0,0 +1,53 @@ +# UpdateApiKeyName + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateApiKeyName**](UpdateApiKeyName.md#UpdateApiKeyName) | **Patch** /v3/api_keys/{ApiKeyId} | Update API key name + + + +## UpdateApiKeyName + +> ApiKeyResponse UpdateApiKeyName(ctx, ApiKeyIdoptional) + +Update API key name + +**This endpoint allows you to update the name of an existing API Key.** You must pass this endpoint a JSON request body with a `name` property, which will be used to rename the key associated with the `api_key_id` passed in the URL. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ApiKeyId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateApiKeyNameParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateApiKeyNameRequest** | [**UpdateApiKeyNameRequest**](UpdateApiKeyNameRequest.md) | + +### Return type + +[**ApiKeyResponse**](ApiKeyResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/api_keys/docs/UpdateApiKeyNameRequest.md b/rest/api/v3/api_keys/docs/UpdateApiKeyNameRequest.md new file mode 100644 index 00000000..bf4a4e51 --- /dev/null +++ b/rest/api/v3/api_keys/docs/UpdateApiKeyNameRequest.md @@ -0,0 +1,11 @@ +# UpdateApiKeyNameRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The new name of the API Key. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/docs/UpdateApiKeyRequest.md b/rest/api/v3/api_keys/docs/UpdateApiKeyRequest.md new file mode 100644 index 00000000..06c502e3 --- /dev/null +++ b/rest/api/v3/api_keys/docs/UpdateApiKeyRequest.md @@ -0,0 +1,12 @@ +# UpdateApiKeyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**Scopes** | **[]string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/api_keys/model_api_key_response.go b/rest/api/v3/api_keys/model_api_key_response.go new file mode 100644 index 00000000..32f2fcf9 --- /dev/null +++ b/rest/api/v3/api_keys/model_api_key_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ApiKeyResponse struct for ApiKeyResponse +type ApiKeyResponse struct { + // The ID of your API Key. + ApiKeyId *string `json:"api_key_id,omitempty"` + // The name of your API Key. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_api_key_scopes_response.go b/rest/api/v3/api_keys/model_api_key_scopes_response.go new file mode 100644 index 00000000..25d1c7bc --- /dev/null +++ b/rest/api/v3/api_keys/model_api_key_scopes_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ApiKeyScopesResponse struct for ApiKeyScopesResponse +type ApiKeyScopesResponse struct { + // The permissions this API Key has access to. + Scopes *[]string `json:"scopes,omitempty"` + // The ID of your API Key. + ApiKeyId *string `json:"api_key_id,omitempty"` + // The name of your API Key. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_create_api_key_201_response.go b/rest/api/v3/api_keys/model_create_api_key_201_response.go new file mode 100644 index 00000000..bd196421 --- /dev/null +++ b/rest/api/v3/api_keys/model_create_api_key_201_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateApiKey201Response struct for CreateApiKey201Response +type CreateApiKey201Response struct { + ApiKey *string `json:"api_key,omitempty"` + ApiKeyId *string `json:"api_key_id,omitempty"` + Name *string `json:"name,omitempty"` + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_create_api_key_request.go b/rest/api/v3/api_keys/model_create_api_key_request.go new file mode 100644 index 00000000..3185d573 --- /dev/null +++ b/rest/api/v3/api_keys/model_create_api_key_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateApiKeyRequest struct for CreateApiKeyRequest +type CreateApiKeyRequest struct { + // The name you will use to describe this API Key. + Name string `json:"name"` + // The individual permissions that you are giving to this API Key. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_error_response.go b/rest/api/v3/api_keys/model_error_response.go new file mode 100644 index 00000000..593ee939 --- /dev/null +++ b/rest/api/v3/api_keys/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_error_response_errors_inner.go b/rest/api/v3/api_keys/model_error_response_errors_inner.go new file mode 100644 index 00000000..909b9fc2 --- /dev/null +++ b/rest/api/v3/api_keys/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_get_api_key_200_response.go b/rest/api/v3/api_keys/model_get_api_key_200_response.go new file mode 100644 index 00000000..72056608 --- /dev/null +++ b/rest/api/v3/api_keys/model_get_api_key_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetApiKey200Response struct for GetApiKey200Response +type GetApiKey200Response struct { + Result *[]ApiKeyScopesResponse `json:"result,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_list_api_key_200_response.go b/rest/api/v3/api_keys/model_list_api_key_200_response.go new file mode 100644 index 00000000..06fb1c13 --- /dev/null +++ b/rest/api/v3/api_keys/model_list_api_key_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListApiKey200Response struct for ListApiKey200Response +type ListApiKey200Response struct { + Result *[]ApiKeyResponse `json:"result,omitempty"` +} diff --git a/rest/api/v3/api_keys/model_update_api_key_name_request.go b/rest/api/v3/api_keys/model_update_api_key_name_request.go new file mode 100644 index 00000000..6b90e1a1 --- /dev/null +++ b/rest/api/v3/api_keys/model_update_api_key_name_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateApiKeyNameRequest struct for UpdateApiKeyNameRequest +type UpdateApiKeyNameRequest struct { + // The new name of the API Key. + Name string `json:"name"` +} diff --git a/rest/api/v3/api_keys/model_update_api_key_request.go b/rest/api/v3/api_keys/model_update_api_key_request.go new file mode 100644 index 00000000..303efc75 --- /dev/null +++ b/rest/api/v3/api_keys/model_update_api_key_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid API Keys API +* The Twilio SendGrid API Keys API allows you manage your API keys and their settings. Your application, mail client, or website can all use API keys to authenticate access to SendGrid services. To create your initial SendGrid API Key, you should use the [SendGrid application user interface](https://app.sendgrid.com/settings/api_keys). Once you have created a first key with scopes to manage additional API keys, you can use this API for all other key management. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateApiKeyRequest struct for UpdateApiKeyRequest +type UpdateApiKeyRequest struct { + Name string `json:"name"` + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/README.md b/rest/api/v3/domain_authentication/README.md new file mode 100644 index 00000000..5a105004 --- /dev/null +++ b/rest/api/v3/domain_authentication/README.md @@ -0,0 +1,103 @@ +# Go API client for + +The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. + +Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). + +Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.511283+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AddIpToAuthenticatedDomain* | [**AddIpToAuthenticatedDomain**](docs/AddIpToAuthenticatedDomain.md#addiptoauthenticateddomain) | **Post** /v3/whitelabel/domains/{Id}/ips | Add an IP to an authenticated domain +*AssociateSubuserWithDomain* | [**AssociateSubuserWithDomain**](docs/AssociateSubuserWithDomain.md#associatesubuserwithdomain) | **Post** /v3/whitelabel/domains/{DomainId}/subuser | Associate an authenticated domain with a given user. +*AssociateSubuserWithDomainMultiple* | [**AssociateSubuserWithDomainMultiple**](docs/AssociateSubuserWithDomainMultiple.md#associatesubuserwithdomainmultiple) | **Post** /v3/whitelabel/domains/{DomainId}/subuser:add | Associate an authenticated domain with a given user, for up to five domains. +*AuthenticateDomain* | [**AuthenticateDomain**](docs/AuthenticateDomain.md#authenticatedomain) | **Post** /v3/whitelabel/domains | Authenticate a domain +*DeleteAuthenticatedDomain* | [**DeleteAuthenticatedDomain**](docs/DeleteAuthenticatedDomain.md#deleteauthenticateddomain) | **Delete** /v3/whitelabel/domains/{DomainId} | Delete an authenticated domain. +*DeleteIpFromAuthenticatedDomain* | [**DeleteIpFromAuthenticatedDomain**](docs/DeleteIpFromAuthenticatedDomain.md#deleteipfromauthenticateddomain) | **Delete** /v3/whitelabel/domains/{Id}/ips/{Ip} | Remove an IP from an authenticated domain. +*DisassociateAuthenticatedDomainFromUser* | [**DisassociateAuthenticatedDomainFromUser**](docs/DisassociateAuthenticatedDomainFromUser.md#disassociateauthenticateddomainfromuser) | **Delete** /v3/whitelabel/domains/subuser | Disassociate an authenticated domain from a given user. +*DisassociateSubuserFromDomain* | [**DisassociateSubuserFromDomain**](docs/DisassociateSubuserFromDomain.md#disassociatesubuserfromdomain) | **Delete** /v3/whitelabel/domains/{DomainId}/subuser | Disassociate an authenticated domain from a given user for users with up to five associated domains. +*EmailDnsRecord* | [**EmailDnsRecord**](docs/EmailDnsRecord.md#emaildnsrecord) | **Post** /v3/whitelabel/dns/email | Email DNS records to a co-worker +*GetAuthenticatedDomain* | [**GetAuthenticatedDomain**](docs/GetAuthenticatedDomain.md#getauthenticateddomain) | **Get** /v3/whitelabel/domains/{DomainId} | Retrieve an authenticated domain +*ListAllAuthenticatedDomainWithUser* | [**ListAllAuthenticatedDomainWithUser**](docs/ListAllAuthenticatedDomainWithUser.md#listallauthenticateddomainwithuser) | **Get** /v3/whitelabel/domains/subuser/all | List all the authenticated domains associated with the given user. +*ListAuthenticatedDomain* | [**ListAuthenticatedDomain**](docs/ListAuthenticatedDomain.md#listauthenticateddomain) | **Get** /v3/whitelabel/domains | List all authenticated domains +*ListAuthenticatedDomainWithUser* | [**ListAuthenticatedDomainWithUser**](docs/ListAuthenticatedDomainWithUser.md#listauthenticateddomainwithuser) | **Get** /v3/whitelabel/domains/subuser | List the authenticated domain associated with the given user. +*ListDefaultAuthenticatedDomain* | [**ListDefaultAuthenticatedDomain**](docs/ListDefaultAuthenticatedDomain.md#listdefaultauthenticateddomain) | **Get** /v3/whitelabel/domains/default | Get the default authentication +*UpdateAuthenticatedDomain* | [**UpdateAuthenticatedDomain**](docs/UpdateAuthenticatedDomain.md#updateauthenticateddomain) | **Patch** /v3/whitelabel/domains/{DomainId} | Update an authenticated domain +*ValidateAuthenticatedDomain* | [**ValidateAuthenticatedDomain**](docs/ValidateAuthenticatedDomain.md#validateauthenticateddomain) | **Post** /v3/whitelabel/domains/{Id}/validate | Validate a domain authentication. + + +## Documentation For Models + + - [AddIpToAuthenticatedDomainRequest](AddIpToAuthenticatedDomainRequest.md) + - [AssociateSubuserWithDomainRequest](AssociateSubuserWithDomainRequest.md) + - [AuthenticateDomainRequest](AuthenticateDomainRequest.md) + - [AuthenticatedDomain](AuthenticatedDomain.md) + - [AuthenticatedDomainSpf](AuthenticatedDomainSpf.md) + - [AuthenticatedDomainSpfDns](AuthenticatedDomainSpfDns.md) + - [AuthenticatedDomainSpfDnsDkim](AuthenticatedDomainSpfDnsDkim.md) + - [AuthenticatedDomainSpfDnsDomainSpf](AuthenticatedDomainSpfDnsDomainSpf.md) + - [AuthenticatedDomainSpfDnsMailServer](AuthenticatedDomainSpfDnsMailServer.md) + - [AuthenticatedDomainSpfDnsSubdomainSpf](AuthenticatedDomainSpfDnsSubdomainSpf.md) + - [EmailDnsRecord400Response](EmailDnsRecord400Response.md) + - [EmailDnsRecord400ResponseErrors](EmailDnsRecord400ResponseErrors.md) + - [EmailDnsRecordRequest](EmailDnsRecordRequest.md) + - [ListAllAuthenticatedDomainWithUser200ResponseInner](ListAllAuthenticatedDomainWithUser200ResponseInner.md) + - [ListAllAuthenticatedDomainWithUser200ResponseInnerDns](ListAllAuthenticatedDomainWithUser200ResponseInnerDns.md) + - [ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1](ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1.md) + - [ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname](ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname.md) + - [UpdateAuthenticatedDomainRequest](UpdateAuthenticatedDomainRequest.md) + - [ValidateAuthenticatedDomain200Response](ValidateAuthenticatedDomain200Response.md) + - [ValidateAuthenticatedDomain200ResponseValidationResults](ValidateAuthenticatedDomain200ResponseValidationResults.md) + - [ValidateAuthenticatedDomain200ResponseValidationResultsDkim1](ValidateAuthenticatedDomain200ResponseValidationResultsDkim1.md) + - [ValidateAuthenticatedDomain200ResponseValidationResultsMailCname](ValidateAuthenticatedDomain200ResponseValidationResultsMailCname.md) + - [ValidateAuthenticatedDomain200ResponseValidationResultsSpf](ValidateAuthenticatedDomain200ResponseValidationResultsSpf.md) + - [ValidateAuthenticatedDomain500Response](ValidateAuthenticatedDomain500Response.md) + - [ValidateAuthenticatedDomain500ResponseErrorsInner](ValidateAuthenticatedDomain500ResponseErrorsInner.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/domain_authentication/api_add_ip_to_authenticated_domain.go b/rest/api/v3/domain_authentication/api_add_ip_to_authenticated_domain.go new file mode 100644 index 00000000..4a6cd6d0 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_add_ip_to_authenticated_domain.go @@ -0,0 +1,86 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type AddIpToAuthenticatedDomainParam struct { + // ID of the domain to which you are adding an IP + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + AddIpToAuthenticatedDomainRequest *AddIpToAuthenticatedDomainRequest `json:"AddIpToAuthenticatedDomainRequest,omitempty"` +} + +func (params *AddIpToAuthenticatedDomainParam) SetId(Id int32) *AddIpToAuthenticatedDomainParam { + params.Id = &Id + return params +} +func (params *AddIpToAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *AddIpToAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *AddIpToAuthenticatedDomainParam) SetAddIpToAuthenticatedDomainRequest(AddIpToAuthenticatedDomainRequest AddIpToAuthenticatedDomainRequest) *AddIpToAuthenticatedDomainParam { + params.AddIpToAuthenticatedDomainRequest = &AddIpToAuthenticatedDomainRequest + return params +} + +// **This endpoint allows you to add an IP address to an authenticated domain.** +func (c *ApiService) AddIpToAuthenticatedDomain(params *AddIpToAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{Id}/ips" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddIpToAuthenticatedDomainRequest != nil { + b, err := json.Marshal(*params.AddIpToAuthenticatedDomainRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AuthenticatedDomainSpf{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_associate_subuser_with_domain.go b/rest/api/v3/domain_authentication/api_associate_subuser_with_domain.go new file mode 100644 index 00000000..b84c9542 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_associate_subuser_with_domain.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type AssociateSubuserWithDomainParam struct { + // ID of the authenticated domain to associate with the subuser. + DomainId *int32 `json:"domain_id"` + // + AssociateSubuserWithDomainRequest *AssociateSubuserWithDomainRequest `json:"AssociateSubuserWithDomainRequest,omitempty"` +} + +func (params *AssociateSubuserWithDomainParam) SetDomainId(DomainId int32) *AssociateSubuserWithDomainParam { + params.DomainId = &DomainId + return params +} +func (params *AssociateSubuserWithDomainParam) SetAssociateSubuserWithDomainRequest(AssociateSubuserWithDomainRequest AssociateSubuserWithDomainRequest) *AssociateSubuserWithDomainParam { + params.AssociateSubuserWithDomainRequest = &AssociateSubuserWithDomainRequest + return params +} + +// **This endpoint allows you to associate a specific authenticated domain with a subuser.** Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. [You can associate more than one domain with a subuser using the `v3/whitelabel/domains/{domain_id}/subuser:add` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/associate-an-authenticated-domain-with-a-subuser-multiple). +func (c *ApiService) AssociateSubuserWithDomain(params *AssociateSubuserWithDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{DomainId}/subuser" + if params != nil && params.DomainId != nil { + path = strings.Replace(path, "{"+"DomainId"+"}", fmt.Sprint(*params.DomainId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AssociateSubuserWithDomainRequest != nil { + b, err := json.Marshal(*params.AssociateSubuserWithDomainRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &AuthenticatedDomainSpf{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_associate_subuser_with_domain_multiple.go b/rest/api/v3/domain_authentication/api_associate_subuser_with_domain_multiple.go new file mode 100644 index 00000000..2cb05b45 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_associate_subuser_with_domain_multiple.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type AssociateSubuserWithDomainMultipleParam struct { + // ID of the authenticated domain to associate with the subuser. + DomainId *int32 `json:"domain_id"` + // + AssociateSubuserWithDomainRequest *AssociateSubuserWithDomainRequest `json:"AssociateSubuserWithDomainRequest,omitempty"` +} + +func (params *AssociateSubuserWithDomainMultipleParam) SetDomainId(DomainId int32) *AssociateSubuserWithDomainMultipleParam { + params.DomainId = &DomainId + return params +} +func (params *AssociateSubuserWithDomainMultipleParam) SetAssociateSubuserWithDomainRequest(AssociateSubuserWithDomainRequest AssociateSubuserWithDomainRequest) *AssociateSubuserWithDomainMultipleParam { + params.AssociateSubuserWithDomainRequest = &AssociateSubuserWithDomainRequest + return params +} + +// **This endpoint allows you to associate a specific authenticated domain with a subuser. It can be used to associate up to five authenticated domains.** This functionality allows subusers to send mail using their parent's domain. Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. A subuser can have up to five associated authenticated domains. To see the domains that have already been associated with this user, you can [use the API to list the domains currently associated with the subuser](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/list-the-authenticated-domain-associated-with-a-subuser-multiple). When selecting a domain to send email from, SendGrid checks for domains in the following order and chooses the first one that appears in the hierarchy: 1. Domain assigned by the subuser that matches the email's `From` address domain. 2. The subuser's default domain. 3. Domain assigned by the parent user that matches the `From` address domain. 4. Parent user's default domain. 5. sendgrid.net +func (c *ApiService) AssociateSubuserWithDomainMultiple(params *AssociateSubuserWithDomainMultipleParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{DomainId}/subuser:add" + if params != nil && params.DomainId != nil { + path = strings.Replace(path, "{"+"DomainId"+"}", fmt.Sprint(*params.DomainId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AssociateSubuserWithDomainRequest != nil { + b, err := json.Marshal(*params.AssociateSubuserWithDomainRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &AuthenticatedDomainSpf{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_authenticate_domain.go b/rest/api/v3/domain_authentication/api_authenticate_domain.go new file mode 100644 index 00000000..d06be95e --- /dev/null +++ b/rest/api/v3/domain_authentication/api_authenticate_domain.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type AuthenticateDomainParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + AuthenticateDomainRequest *AuthenticateDomainRequest `json:"AuthenticateDomainRequest,omitempty"` +} + +func (params *AuthenticateDomainParam) SetOnbehalfof(Onbehalfof string) *AuthenticateDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *AuthenticateDomainParam) SetAuthenticateDomainRequest(AuthenticateDomainRequest AuthenticateDomainRequest) *AuthenticateDomainParam { + params.AuthenticateDomainRequest = &AuthenticateDomainRequest + return params +} + +// **This endpoint allows you to authenticate a domain.** If you are authenticating a domain for a subuser, you have two options: 1. Use the \"username\" parameter. This allows you to authenticate a domain on behalf of your subuser. This means the subuser is able to see and modify the authenticated domain. 2. Use the Association workflow (see Associate Domain section). This allows you to authenticate a domain created by the parent to a subuser. This means the subuser will default to the assigned domain, but will not be able to see or modify that authenticated domain. However, if the subuser authenticates their own domain it will overwrite the assigned domain. +func (c *ApiService) AuthenticateDomain(params *AuthenticateDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AuthenticateDomainRequest != nil { + b, err := json.Marshal(*params.AuthenticateDomainRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &AuthenticatedDomain{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_delete_authenticated_domain.go b/rest/api/v3/domain_authentication/api_delete_authenticated_domain.go new file mode 100644 index 00000000..a70ae056 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_delete_authenticated_domain.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteAuthenticatedDomainParam struct { + // + DomainId *string `json:"domain_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteAuthenticatedDomainParam) SetDomainId(DomainId string) *DeleteAuthenticatedDomainParam { + params.DomainId = &DomainId + return params +} +func (params *DeleteAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *DeleteAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete an authenticated domain.** +func (c *ApiService) DeleteAuthenticatedDomain(params *DeleteAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{DomainId}" + if params != nil && params.DomainId != nil { + path = strings.Replace(path, "{"+"DomainId"+"}", *params.DomainId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_delete_ip_from_authenticated_domain.go b/rest/api/v3/domain_authentication/api_delete_ip_from_authenticated_domain.go new file mode 100644 index 00000000..9944cc46 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_delete_ip_from_authenticated_domain.go @@ -0,0 +1,80 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteIpFromAuthenticatedDomainParam struct { + // ID of the domain to delete the IP from. + Id *int32 `json:"id"` + // IP to remove from the domain. + Ip *string `json:"ip"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteIpFromAuthenticatedDomainParam) SetId(Id int32) *DeleteIpFromAuthenticatedDomainParam { + params.Id = &Id + return params +} +func (params *DeleteIpFromAuthenticatedDomainParam) SetIp(Ip string) *DeleteIpFromAuthenticatedDomainParam { + params.Ip = &Ip + return params +} +func (params *DeleteIpFromAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *DeleteIpFromAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to remove an IP address from that domain's authentication.** +func (c *ApiService) DeleteIpFromAuthenticatedDomain(params *DeleteIpFromAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{Id}/ips/{Ip}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + if params != nil && params.Ip != nil { + path = strings.Replace(path, "{"+"Ip"+"}", *params.Ip, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AuthenticatedDomainSpf{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_disassociate_authenticated_domain_from_user.go b/rest/api/v3/domain_authentication/api_disassociate_authenticated_domain_from_user.go new file mode 100644 index 00000000..72c7ebf0 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_disassociate_authenticated_domain_from_user.go @@ -0,0 +1,60 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type DisassociateAuthenticatedDomainFromUserParam struct { + // Username for the subuser to find associated authenticated domain. + Username *string `json:"username,omitempty"` +} + +func (params *DisassociateAuthenticatedDomainFromUserParam) SetUsername(Username string) *DisassociateAuthenticatedDomainFromUserParam { + params.Username = &Username + return params +} + +// **This endpoint allows you to disassociate a specific authenticated domain from a subuser.** Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. Note that if you used the [`/v3/whitelabel/domains/{domain_id}/subuser:add` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/associate-an-authenticated-domain-with-a-subuser-multiple) to add multiple domains to the subuser, you should use the [`/v3/whitelabel/domains/{domain_id}/subuser` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/disassociate-an-authenticated-domain-from-a-subuser-multiple) to disassociate those domains. +func (c *ApiService) DisassociateAuthenticatedDomainFromUser(params *DisassociateAuthenticatedDomainFromUserParam) (interface{}, error) { + path := "/v3/whitelabel/domains/subuser" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_disassociate_subuser_from_domain.go b/rest/api/v3/domain_authentication/api_disassociate_subuser_from_domain.go new file mode 100644 index 00000000..c84c69fa --- /dev/null +++ b/rest/api/v3/domain_authentication/api_disassociate_subuser_from_domain.go @@ -0,0 +1,72 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DisassociateSubuserFromDomainParam struct { + // ID of the authenticated domain to be disassociated with the subuser. + DomainId *int32 `json:"domain_id"` + // Username for the subuser to find associated authenticated domain. + Username *string `json:"username,omitempty"` +} + +func (params *DisassociateSubuserFromDomainParam) SetDomainId(DomainId int32) *DisassociateSubuserFromDomainParam { + params.DomainId = &DomainId + return params +} +func (params *DisassociateSubuserFromDomainParam) SetUsername(Username string) *DisassociateSubuserFromDomainParam { + params.Username = &Username + return params +} + +// **This endpoint allows you to disassociate a specific authenticated domain from a subuser, for users with up to five associated domains.** This functionality allows subusers to send mail using their parent's domain. Authenticated domains can be associated with (i.e. assigned to) subusers kknt, and a subuser can have up to five associated authenticated domains. You can dissociate an authenticated domain from any subuser that has one or more authenticated domains using this endpoint. +func (c *ApiService) DisassociateSubuserFromDomain(params *DisassociateSubuserFromDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{DomainId}/subuser" + if params != nil && params.DomainId != nil { + path = strings.Replace(path, "{"+"DomainId"+"}", fmt.Sprint(*params.DomainId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_email_dns_record.go b/rest/api/v3/domain_authentication/api_email_dns_record.go new file mode 100644 index 00000000..3c87da0e --- /dev/null +++ b/rest/api/v3/domain_authentication/api_email_dns_record.go @@ -0,0 +1,65 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type EmailDnsRecordParam struct { + // + EmailDnsRecordRequest *EmailDnsRecordRequest `json:"EmailDnsRecordRequest,omitempty"` +} + +func (params *EmailDnsRecordParam) SetEmailDnsRecordRequest(EmailDnsRecordRequest EmailDnsRecordRequest) *EmailDnsRecordParam { + params.EmailDnsRecordRequest = &EmailDnsRecordRequest + return params +} + +// **This endpoint is used to share DNS records with a colleagues** Use this endpoint to send SendGrid-generated DNS record information to a co-worker so they can enter it into your DNS provider to validate your domain and link branding. What type of records are sent will depend on whether you have chosen Automated Security or not. When using Automated Security, SendGrid provides you with three CNAME records. If you turn Automated Security off, you are instead given TXT and MX records. If you pass a `link_id` to this endpoint, the generated email will supply the DNS records necessary to complete [Link Branding](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) setup. If you pass a `domain_id` to this endpoint, the generated email will supply the DNS records needed to complete [Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Passing both IDs will generate an email with the records needed to complete both setup steps. You can retrieve all your domain IDs from the returned `id` fields for each domain using the \"List all authenticated domains\" endpoint. You can retrieve all of your link IDs using the \"Retrieve all branded links\" endpoint. +func (c *ApiService) EmailDnsRecord(params *EmailDnsRecordParam) (interface{}, error) { + path := "/v3/whitelabel/dns/email" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.EmailDnsRecordRequest != nil { + b, err := json.Marshal(*params.EmailDnsRecordRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &EmailDnsRecord400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_get_authenticated_domain.go b/rest/api/v3/domain_authentication/api_get_authenticated_domain.go new file mode 100644 index 00000000..ea02910f --- /dev/null +++ b/rest/api/v3/domain_authentication/api_get_authenticated_domain.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetAuthenticatedDomainParam struct { + // + DomainId *string `json:"domain_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetAuthenticatedDomainParam) SetDomainId(DomainId string) *GetAuthenticatedDomainParam { + params.DomainId = &DomainId + return params +} +func (params *GetAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *GetAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific authenticated domain.** +func (c *ApiService) GetAuthenticatedDomain(params *GetAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{DomainId}" + if params != nil && params.DomainId != nil { + path = strings.Replace(path, "{"+"DomainId"+"}", *params.DomainId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AuthenticatedDomain{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_list_all_authenticated_domain_with_user.go b/rest/api/v3/domain_authentication/api_list_all_authenticated_domain_with_user.go new file mode 100644 index 00000000..ba07edd3 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_list_all_authenticated_domain_with_user.go @@ -0,0 +1,60 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListAllAuthenticatedDomainWithUserParam struct { + // Username for the subuser to find associated authenticated domains. + Username *string `json:"username"` +} + +func (params *ListAllAuthenticatedDomainWithUserParam) SetUsername(Username string) *ListAllAuthenticatedDomainWithUserParam { + params.Username = &Username + return params +} + +// **This endpoint allows you to retrieve all of the authenticated domains that have been assigned to a specific subuser.** This functionality allows subusers to send mail using their parent's domain. Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account, and a subuser can have up to five associated domains. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. When selecting a domain to send email from, SendGrid checks for domains in the following order and chooses the first one that appears in the hierarchy: 1. Domain assigned by the subuser that matches the email's `From` address domain. 2. The subuser's default domain. 3. Domain assigned by the parent user that matches the `From` address domain. 4. Parent user's default domain. 5. sendgrid.net +func (c *ApiService) ListAllAuthenticatedDomainWithUser(params *ListAllAuthenticatedDomainWithUserParam) (interface{}, error) { + path := "/v3/whitelabel/domains/subuser/all" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListAllAuthenticatedDomainWithUser200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_list_authenticated_domain.go b/rest/api/v3/domain_authentication/api_list_authenticated_domain.go new file mode 100644 index 00000000..946c626e --- /dev/null +++ b/rest/api/v3/domain_authentication/api_list_authenticated_domain.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListAuthenticatedDomainParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // Exclude subuser domains from the result. + ExcludeSubusers *bool `json:"exclude_subusers,omitempty"` + // The username associated with an authenticated domain. + Username *string `json:"username,omitempty"` + // Search for authenticated domains. + Domain *string `json:"domain,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListAuthenticatedDomainParam) SetLimit(Limit int32) *ListAuthenticatedDomainParam { + params.Limit = &Limit + return params +} +func (params *ListAuthenticatedDomainParam) SetOffset(Offset int32) *ListAuthenticatedDomainParam { + params.Offset = &Offset + return params +} +func (params *ListAuthenticatedDomainParam) SetExcludeSubusers(ExcludeSubusers bool) *ListAuthenticatedDomainParam { + params.ExcludeSubusers = &ExcludeSubusers + return params +} +func (params *ListAuthenticatedDomainParam) SetUsername(Username string) *ListAuthenticatedDomainParam { + params.Username = &Username + return params +} +func (params *ListAuthenticatedDomainParam) SetDomain(Domain string) *ListAuthenticatedDomainParam { + params.Domain = &Domain + return params +} +func (params *ListAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *ListAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all domains you have authenticated.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListAuthenticatedDomain(params *ListAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.ExcludeSubusers != nil { + data.Set("exclude_subusers", fmt.Sprint(*params.ExcludeSubusers)) + } + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + if params != nil && params.Domain != nil { + data.Set("domain", *params.Domain) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_list_authenticated_domain_with_user.go b/rest/api/v3/domain_authentication/api_list_authenticated_domain_with_user.go new file mode 100644 index 00000000..75230a0a --- /dev/null +++ b/rest/api/v3/domain_authentication/api_list_authenticated_domain_with_user.go @@ -0,0 +1,60 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListAuthenticatedDomainWithUserParam struct { + // Username for the subuser to find associated authenticated domain. + Username *string `json:"username"` +} + +func (params *ListAuthenticatedDomainWithUserParam) SetUsername(Username string) *ListAuthenticatedDomainWithUserParam { + params.Username = &Username + return params +} + +// **This endpoint allows you to retrieve all of the authenticated domains that have been assigned to a specific subuser.** Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. Note that if you used the [`/v3/whitelabel/domains/{domain_id}/subuser:add` endpoint]( https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/associate-an-authenticated-domain-with-a-subuser-multiple) to add multiple domains to the subuser, you can use the [`/v3/whitelabel/domains/subuser/all` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/list-the-authenticated-domain-associated-with-a-subuser-multiple) to list those associated domains. +func (c *ApiService) ListAuthenticatedDomainWithUser(params *ListAuthenticatedDomainWithUserParam) (interface{}, error) { + path := "/v3/whitelabel/domains/subuser" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AuthenticatedDomainSpf{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_list_default_authenticated_domain.go b/rest/api/v3/domain_authentication/api_list_default_authenticated_domain.go new file mode 100644 index 00000000..c99a0584 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_list_default_authenticated_domain.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListDefaultAuthenticatedDomainParam struct { + // The domain to find a default authentication. + Domain *string `json:"domain,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListDefaultAuthenticatedDomainParam) SetDomain(Domain string) *ListDefaultAuthenticatedDomainParam { + params.Domain = &Domain + return params +} +func (params *ListDefaultAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *ListDefaultAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the default authentication for a domain.** When creating or updating a domain authentication, you can set the domain as a default. The default domain will be used to send all mail. If you have multiple authenticated domains, the authenticated domain matching the domain of the From address will be used, and the default will be overridden. This endpoint will return a default domain and its details only if a default is set. You are not required to set a default. If you do not set a default domain, this endpoint will return general information about your domain authentication status. +func (c *ApiService) ListDefaultAuthenticatedDomain(params *ListDefaultAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/default" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Domain != nil { + data.Set("domain", *params.Domain) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_service.go b/rest/api/v3/domain_authentication/api_service.go new file mode 100644 index 00000000..bfe66aff --- /dev/null +++ b/rest/api/v3/domain_authentication/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/domain_authentication/api_update_authenticated_domain.go b/rest/api/v3/domain_authentication/api_update_authenticated_domain.go new file mode 100644 index 00000000..50ff1e32 --- /dev/null +++ b/rest/api/v3/domain_authentication/api_update_authenticated_domain.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateAuthenticatedDomainParam struct { + // + DomainId *string `json:"domain_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateAuthenticatedDomainRequest *UpdateAuthenticatedDomainRequest `json:"UpdateAuthenticatedDomainRequest,omitempty"` +} + +func (params *UpdateAuthenticatedDomainParam) SetDomainId(DomainId string) *UpdateAuthenticatedDomainParam { + params.DomainId = &DomainId + return params +} +func (params *UpdateAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *UpdateAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateAuthenticatedDomainParam) SetUpdateAuthenticatedDomainRequest(UpdateAuthenticatedDomainRequest UpdateAuthenticatedDomainRequest) *UpdateAuthenticatedDomainParam { + params.UpdateAuthenticatedDomainRequest = &UpdateAuthenticatedDomainRequest + return params +} + +// **This endpoint allows you to update the settings for an authenticated domain.** +func (c *ApiService) UpdateAuthenticatedDomain(params *UpdateAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{DomainId}" + if params != nil && params.DomainId != nil { + path = strings.Replace(path, "{"+"DomainId"+"}", *params.DomainId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateAuthenticatedDomainRequest != nil { + b, err := json.Marshal(*params.UpdateAuthenticatedDomainRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/api_validate_authenticated_domain.go b/rest/api/v3/domain_authentication/api_validate_authenticated_domain.go new file mode 100644 index 00000000..9a19d23d --- /dev/null +++ b/rest/api/v3/domain_authentication/api_validate_authenticated_domain.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ValidateAuthenticatedDomainParam struct { + // ID of the domain to validate. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ValidateAuthenticatedDomainParam) SetId(Id int32) *ValidateAuthenticatedDomainParam { + params.Id = &Id + return params +} +func (params *ValidateAuthenticatedDomainParam) SetOnbehalfof(Onbehalfof string) *ValidateAuthenticatedDomainParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to validate an authenticated domain. If it fails, it will return an error message describing why the domain could not be validated.** +func (c *ApiService) ValidateAuthenticatedDomain(params *ValidateAuthenticatedDomainParam) (interface{}, error) { + path := "/v3/whitelabel/domains/{Id}/validate" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ValidateAuthenticatedDomain200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ValidateAuthenticatedDomain500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomain.md new file mode 100644 index 00000000..cc716fea --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomain.md @@ -0,0 +1,53 @@ +# AddIpToAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddIpToAuthenticatedDomain**](AddIpToAuthenticatedDomain.md#AddIpToAuthenticatedDomain) | **Post** /v3/whitelabel/domains/{Id}/ips | Add an IP to an authenticated domain + + + +## AddIpToAuthenticatedDomain + +> AuthenticatedDomainSpf AddIpToAuthenticatedDomain(ctx, Idoptional) + +Add an IP to an authenticated domain + +**This endpoint allows you to add an IP address to an authenticated domain.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | ID of the domain to which you are adding an IP + +### Other Parameters + +Other parameters are passed through a pointer to a AddIpToAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**AddIpToAuthenticatedDomainRequest** | [**AddIpToAuthenticatedDomainRequest**](AddIpToAuthenticatedDomainRequest.md) | + +### Return type + +[**AuthenticatedDomainSpf**](AuthenticatedDomainSpf.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomainRequest.md b/rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomainRequest.md new file mode 100644 index 00000000..6eba37a6 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AddIpToAuthenticatedDomainRequest.md @@ -0,0 +1,11 @@ +# AddIpToAuthenticatedDomainRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | IP to associate with the domain. Used for manually specifying IPs for custom SPF. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomain.md b/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomain.md new file mode 100644 index 00000000..f96c9ebb --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomain.md @@ -0,0 +1,52 @@ +# AssociateSubuserWithDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AssociateSubuserWithDomain**](AssociateSubuserWithDomain.md#AssociateSubuserWithDomain) | **Post** /v3/whitelabel/domains/{DomainId}/subuser | Associate an authenticated domain with a given user. + + + +## AssociateSubuserWithDomain + +> AuthenticatedDomainSpf AssociateSubuserWithDomain(ctx, DomainIdoptional) + +Associate an authenticated domain with a given user. + +**This endpoint allows you to associate a specific authenticated domain with a subuser.** Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. [You can associate more than one domain with a subuser using the `v3/whitelabel/domains/{domain_id}/subuser:add` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/associate-an-authenticated-domain-with-a-subuser-multiple). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**DomainId** | **int32** | ID of the authenticated domain to associate with the subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a AssociateSubuserWithDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AssociateSubuserWithDomainRequest** | [**AssociateSubuserWithDomainRequest**](AssociateSubuserWithDomainRequest.md) | + +### Return type + +[**AuthenticatedDomainSpf**](AuthenticatedDomainSpf.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainMultiple.md b/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainMultiple.md new file mode 100644 index 00000000..7aec4d78 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainMultiple.md @@ -0,0 +1,52 @@ +# AssociateSubuserWithDomainMultiple + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AssociateSubuserWithDomainMultiple**](AssociateSubuserWithDomainMultiple.md#AssociateSubuserWithDomainMultiple) | **Post** /v3/whitelabel/domains/{DomainId}/subuser:add | Associate an authenticated domain with a given user, for up to five domains. + + + +## AssociateSubuserWithDomainMultiple + +> AuthenticatedDomainSpf AssociateSubuserWithDomainMultiple(ctx, DomainIdoptional) + +Associate an authenticated domain with a given user, for up to five domains. + +**This endpoint allows you to associate a specific authenticated domain with a subuser. It can be used to associate up to five authenticated domains.** This functionality allows subusers to send mail using their parent's domain. Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. A subuser can have up to five associated authenticated domains. To see the domains that have already been associated with this user, you can [use the API to list the domains currently associated with the subuser](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/list-the-authenticated-domain-associated-with-a-subuser-multiple). When selecting a domain to send email from, SendGrid checks for domains in the following order and chooses the first one that appears in the hierarchy: 1. Domain assigned by the subuser that matches the email's `From` address domain. 2. The subuser's default domain. 3. Domain assigned by the parent user that matches the `From` address domain. 4. Parent user's default domain. 5. sendgrid.net + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**DomainId** | **int32** | ID of the authenticated domain to associate with the subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a AssociateSubuserWithDomainMultipleParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AssociateSubuserWithDomainRequest** | [**AssociateSubuserWithDomainRequest**](AssociateSubuserWithDomainRequest.md) | + +### Return type + +[**AuthenticatedDomainSpf**](AuthenticatedDomainSpf.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainRequest.md b/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainRequest.md new file mode 100644 index 00000000..ed7c75bf --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AssociateSubuserWithDomainRequest.md @@ -0,0 +1,11 @@ +# AssociateSubuserWithDomainRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | Username to associate with the authenticated domain. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticateDomain.md b/rest/api/v3/domain_authentication/docs/AuthenticateDomain.md new file mode 100644 index 00000000..950f3cce --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticateDomain.md @@ -0,0 +1,49 @@ +# AuthenticateDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AuthenticateDomain**](AuthenticateDomain.md#AuthenticateDomain) | **Post** /v3/whitelabel/domains | Authenticate a domain + + + +## AuthenticateDomain + +> AuthenticatedDomain AuthenticateDomain(ctx, optional) + +Authenticate a domain + +**This endpoint allows you to authenticate a domain.** If you are authenticating a domain for a subuser, you have two options: 1. Use the \"username\" parameter. This allows you to authenticate a domain on behalf of your subuser. This means the subuser is able to see and modify the authenticated domain. 2. Use the Association workflow (see Associate Domain section). This allows you to authenticate a domain created by the parent to a subuser. This means the subuser will default to the assigned domain, but will not be able to see or modify that authenticated domain. However, if the subuser authenticates their own domain it will overwrite the assigned domain. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a AuthenticateDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**AuthenticateDomainRequest** | [**AuthenticateDomainRequest**](AuthenticateDomainRequest.md) | + +### Return type + +[**AuthenticatedDomain**](AuthenticatedDomain.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticateDomainRequest.md b/rest/api/v3/domain_authentication/docs/AuthenticateDomainRequest.md new file mode 100644 index 00000000..35a69969 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticateDomainRequest.md @@ -0,0 +1,19 @@ +# AuthenticateDomainRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Domain** | **string** | Domain being authenticated. | +**Subdomain** | **string** | The subdomain to use for this authenticated domain. |[optional] +**Username** | **string** | The username associated with this domain. |[optional] +**Ips** | **[]string** | The IP addresses that will be included in the custom SPF record for this authenticated domain. |[optional] +**CustomSpf** | **bool** | Specify whether to use a custom SPF or allow SendGrid to manage your SPF. This option is only available to authenticated domains set up for manual security. |[optional] +**Default** | **bool** | Whether to use this authenticated domain as the fallback if no authenticated domains match the sender's domain. |[optional] +**AutomaticSecurity** | **bool** | Whether to allow SendGrid to manage your SPF records, DKIM keys, and DKIM key rotation. |[optional] +**CustomDkimSelector** | **string** | Add a custom DKIM selector. Accepts three letters or numbers. |[optional] +**Region** | **string** | The region of the domain. Allowed values are `global` and `eu`. The default value is `global`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/AuthenticatedDomain.md new file mode 100644 index 00000000..6cd5c65b --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticatedDomain.md @@ -0,0 +1,22 @@ +# AuthenticatedDomain + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **float32** | The ID of the authenticated domain. | +**UserId** | **float32** | The ID of the user that this domain is associated with. | +**Subdomain** | **string** | The subdomain to use for this authenticated domain. | +**Domain** | **string** | The domain to be authenticated. | +**Username** | **string** | The username that this domain will be associated with. | +**Ips** | **[]string** | The IPs to be included in the custom SPF record for this authenticated domain. | +**CustomSpf** | **bool** | Indicates whether this authenticated domain uses custom SPF. | +**Default** | **bool** | Indicates if this is the default authenticated domain. | +**Legacy** | **bool** | Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it. | +**AutomaticSecurity** | **bool** | Indicates if this authenticated domain uses automated security. | +**Valid** | **bool** | Indicates if this is a valid authenticated domain. | +**Dns** | [**ListAllAuthenticatedDomainWithUser200ResponseInnerDns**](ListAllAuthenticatedDomainWithUser200ResponseInnerDns.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpf.md b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpf.md new file mode 100644 index 00000000..1f08a00e --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpf.md @@ -0,0 +1,22 @@ +# AuthenticatedDomainSpf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the authenticated domain. | +**Domain** | **string** | The domain authenticated. | +**Subdomain** | **string** | The subdomain that was used to create this authenticated domain. |[optional] +**Username** | **string** | The username of the account that this authenticated domain is associated with. | +**UserId** | **int32** | The user_id of the account that this authenticated domain is associated with. | +**Ips** | **[]interface{}** | The IP addresses that are included in the SPF record for this authenticated domain. | +**CustomSpf** | **bool** | Indicates if this authenticated domain uses custom SPF. | +**Default** | **bool** | Indicates if this is the default domain. | +**Legacy** | **bool** | Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it. | +**AutomaticSecurity** | **bool** | Indicates if this authenticated domain uses automated security. | +**Valid** | **bool** | Indicates if this is a valid authenticated domain . | +**Dns** | [**AuthenticatedDomainSpfDns**](AuthenticatedDomainSpfDns.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDns.md b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDns.md new file mode 100644 index 00000000..d4eaca8b --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDns.md @@ -0,0 +1,14 @@ +# AuthenticatedDomainSpfDns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MailServer** | [**AuthenticatedDomainSpfDnsMailServer**](AuthenticatedDomainSpfDnsMailServer.md) | | +**SubdomainSpf** | [**AuthenticatedDomainSpfDnsSubdomainSpf**](AuthenticatedDomainSpfDnsSubdomainSpf.md) | | +**DomainSpf** | [**AuthenticatedDomainSpfDnsDomainSpf**](AuthenticatedDomainSpfDnsDomainSpf.md) | | +**Dkim** | [**AuthenticatedDomainSpfDnsDkim**](AuthenticatedDomainSpfDnsDkim.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDkim.md b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDkim.md new file mode 100644 index 00000000..ec37b619 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDkim.md @@ -0,0 +1,14 @@ +# AuthenticatedDomainSpfDnsDkim + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Host** | **string** | The DNS labels for the DKIM signature. | +**Type** | **string** | The type of data in the DKIM record. | +**Data** | **string** | The DKIM record. | +**Valid** | **bool** | Indicates if the DKIM record is valid. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDomainSpf.md b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDomainSpf.md new file mode 100644 index 00000000..f8f4e368 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsDomainSpf.md @@ -0,0 +1,14 @@ +# AuthenticatedDomainSpfDnsDomainSpf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Host** | **string** | The root domain that this SPF record will be used to authenticate. | +**Type** | **string** | The type of data in the SPF record. | +**Data** | **string** | The SPF record. | +**Valid** | **bool** | Indicates if the SPF record is valid. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsMailServer.md b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsMailServer.md new file mode 100644 index 00000000..b50d175b --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsMailServer.md @@ -0,0 +1,14 @@ +# AuthenticatedDomainSpfDnsMailServer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Host** | **string** | The domain sending the messages. | +**Type** | **string** | They type of DNS record. | +**Data** | **string** | The mail server responsible for accepting messages from the sending domain. | +**Valid** | **bool** | Indicates if this is a valid DNS record. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsSubdomainSpf.md b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsSubdomainSpf.md new file mode 100644 index 00000000..f2665a2a --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/AuthenticatedDomainSpfDnsSubdomainSpf.md @@ -0,0 +1,14 @@ +# AuthenticatedDomainSpfDnsSubdomainSpf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Host** | **string** | The domain that this SPF record will be used to authenticate. | +**Type** | **string** | The type of data in the SPF record. | +**Data** | **string** | The SPF record. | +**Valid** | **bool** | Indicates if this is a valid SPF record. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/DeleteAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/DeleteAuthenticatedDomain.md new file mode 100644 index 00000000..eb4c9a6c --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/DeleteAuthenticatedDomain.md @@ -0,0 +1,52 @@ +# DeleteAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteAuthenticatedDomain**](DeleteAuthenticatedDomain.md#DeleteAuthenticatedDomain) | **Delete** /v3/whitelabel/domains/{DomainId} | Delete an authenticated domain. + + + +## DeleteAuthenticatedDomain + +> map[string]interface{} DeleteAuthenticatedDomain(ctx, DomainIdoptional) + +Delete an authenticated domain. + +**This endpoint allows you to delete an authenticated domain.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**DomainId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/DeleteIpFromAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/DeleteIpFromAuthenticatedDomain.md new file mode 100644 index 00000000..a8b5e6a5 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/DeleteIpFromAuthenticatedDomain.md @@ -0,0 +1,53 @@ +# DeleteIpFromAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteIpFromAuthenticatedDomain**](DeleteIpFromAuthenticatedDomain.md#DeleteIpFromAuthenticatedDomain) | **Delete** /v3/whitelabel/domains/{Id}/ips/{Ip} | Remove an IP from an authenticated domain. + + + +## DeleteIpFromAuthenticatedDomain + +> AuthenticatedDomainSpf DeleteIpFromAuthenticatedDomain(ctx, IdIpoptional) + +Remove an IP from an authenticated domain. + +**This endpoint allows you to remove an IP address from that domain's authentication.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | ID of the domain to delete the IP from. +**Ip** | **string** | IP to remove from the domain. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteIpFromAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**AuthenticatedDomainSpf**](AuthenticatedDomainSpf.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/DisassociateAuthenticatedDomainFromUser.md b/rest/api/v3/domain_authentication/docs/DisassociateAuthenticatedDomainFromUser.md new file mode 100644 index 00000000..ccfdb2ea --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/DisassociateAuthenticatedDomainFromUser.md @@ -0,0 +1,48 @@ +# DisassociateAuthenticatedDomainFromUser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DisassociateAuthenticatedDomainFromUser**](DisassociateAuthenticatedDomainFromUser.md#DisassociateAuthenticatedDomainFromUser) | **Delete** /v3/whitelabel/domains/subuser | Disassociate an authenticated domain from a given user. + + + +## DisassociateAuthenticatedDomainFromUser + +> map[string]interface{} DisassociateAuthenticatedDomainFromUser(ctx, optional) + +Disassociate an authenticated domain from a given user. + +**This endpoint allows you to disassociate a specific authenticated domain from a subuser.** Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. Note that if you used the [`/v3/whitelabel/domains/{domain_id}/subuser:add` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/associate-an-authenticated-domain-with-a-subuser-multiple) to add multiple domains to the subuser, you should use the [`/v3/whitelabel/domains/{domain_id}/subuser` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/disassociate-an-authenticated-domain-from-a-subuser-multiple) to disassociate those domains. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a DisassociateAuthenticatedDomainFromUserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Username** | **string** | Username for the subuser to find associated authenticated domain. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/DisassociateSubuserFromDomain.md b/rest/api/v3/domain_authentication/docs/DisassociateSubuserFromDomain.md new file mode 100644 index 00000000..beb09018 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/DisassociateSubuserFromDomain.md @@ -0,0 +1,52 @@ +# DisassociateSubuserFromDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DisassociateSubuserFromDomain**](DisassociateSubuserFromDomain.md#DisassociateSubuserFromDomain) | **Delete** /v3/whitelabel/domains/{DomainId}/subuser | Disassociate an authenticated domain from a given user for users with up to five associated domains. + + + +## DisassociateSubuserFromDomain + +> map[string]interface{} DisassociateSubuserFromDomain(ctx, DomainIdoptional) + +Disassociate an authenticated domain from a given user for users with up to five associated domains. + +**This endpoint allows you to disassociate a specific authenticated domain from a subuser, for users with up to five associated domains.** This functionality allows subusers to send mail using their parent's domain. Authenticated domains can be associated with (i.e. assigned to) subusers kknt, and a subuser can have up to five associated authenticated domains. You can dissociate an authenticated domain from any subuser that has one or more authenticated domains using this endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**DomainId** | **int32** | ID of the authenticated domain to be disassociated with the subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a DisassociateSubuserFromDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Username** | **string** | Username for the subuser to find associated authenticated domain. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/EmailDnsRecord.md b/rest/api/v3/domain_authentication/docs/EmailDnsRecord.md new file mode 100644 index 00000000..6e37810d --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/EmailDnsRecord.md @@ -0,0 +1,48 @@ +# EmailDnsRecord + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**EmailDnsRecord**](EmailDnsRecord.md#EmailDnsRecord) | **Post** /v3/whitelabel/dns/email | Email DNS records to a co-worker + + + +## EmailDnsRecord + +> EmailDnsRecord(ctx, optional) + +Email DNS records to a co-worker + +**This endpoint is used to share DNS records with a colleagues** Use this endpoint to send SendGrid-generated DNS record information to a co-worker so they can enter it into your DNS provider to validate your domain and link branding. What type of records are sent will depend on whether you have chosen Automated Security or not. When using Automated Security, SendGrid provides you with three CNAME records. If you turn Automated Security off, you are instead given TXT and MX records. If you pass a `link_id` to this endpoint, the generated email will supply the DNS records necessary to complete [Link Branding](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) setup. If you pass a `domain_id` to this endpoint, the generated email will supply the DNS records needed to complete [Domain Authentication](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Passing both IDs will generate an email with the records needed to complete both setup steps. You can retrieve all your domain IDs from the returned `id` fields for each domain using the \"List all authenticated domains\" endpoint. You can retrieve all of your link IDs using the \"Retrieve all branded links\" endpoint. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a EmailDnsRecordParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**EmailDnsRecordRequest** | [**EmailDnsRecordRequest**](EmailDnsRecordRequest.md) | + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/EmailDnsRecord400Response.md b/rest/api/v3/domain_authentication/docs/EmailDnsRecord400Response.md new file mode 100644 index 00000000..74634e08 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/EmailDnsRecord400Response.md @@ -0,0 +1,11 @@ +# EmailDnsRecord400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**EmailDnsRecord400ResponseErrors**](EmailDnsRecord400ResponseErrors.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/EmailDnsRecord400ResponseErrors.md b/rest/api/v3/domain_authentication/docs/EmailDnsRecord400ResponseErrors.md new file mode 100644 index 00000000..285e881a --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/EmailDnsRecord400ResponseErrors.md @@ -0,0 +1,12 @@ +# EmailDnsRecord400ResponseErrors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | **string** | |[optional] +**Field** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/EmailDnsRecordRequest.md b/rest/api/v3/domain_authentication/docs/EmailDnsRecordRequest.md new file mode 100644 index 00000000..f4f61a68 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/EmailDnsRecordRequest.md @@ -0,0 +1,14 @@ +# EmailDnsRecordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LinkId** | **int32** | The ID of the branded link. | +**DomainId** | **int32** | The ID of your SendGrid domain record. | +**Email** | **string** | The email address to send the DNS information to. | +**Message** | **string** | A custom text block to include in the email body sent with the records. |[optional] [default to "Please set these DNS records in our hosting solution."] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/GetAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/GetAuthenticatedDomain.md new file mode 100644 index 00000000..e472f781 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/GetAuthenticatedDomain.md @@ -0,0 +1,52 @@ +# GetAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetAuthenticatedDomain**](GetAuthenticatedDomain.md#GetAuthenticatedDomain) | **Get** /v3/whitelabel/domains/{DomainId} | Retrieve an authenticated domain + + + +## GetAuthenticatedDomain + +> AuthenticatedDomain GetAuthenticatedDomain(ctx, DomainIdoptional) + +Retrieve an authenticated domain + +**This endpoint allows you to retrieve a specific authenticated domain.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**DomainId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**AuthenticatedDomain**](AuthenticatedDomain.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser.md b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser.md new file mode 100644 index 00000000..facdf5b6 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser.md @@ -0,0 +1,47 @@ +# ListAllAuthenticatedDomainWithUser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAllAuthenticatedDomainWithUser**](ListAllAuthenticatedDomainWithUser.md#ListAllAuthenticatedDomainWithUser) | **Get** /v3/whitelabel/domains/subuser/all | List all the authenticated domains associated with the given user. + + + +## ListAllAuthenticatedDomainWithUser + +> []ListAllAuthenticatedDomainWithUser200ResponseInner ListAllAuthenticatedDomainWithUser(ctx, Username) + +List all the authenticated domains associated with the given user. + +**This endpoint allows you to retrieve all of the authenticated domains that have been assigned to a specific subuser.** This functionality allows subusers to send mail using their parent's domain. Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account, and a subuser can have up to five associated domains. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. When selecting a domain to send email from, SendGrid checks for domains in the following order and chooses the first one that appears in the hierarchy: 1. Domain assigned by the subuser that matches the email's `From` address domain. 2. The subuser's default domain. 3. Domain assigned by the parent user that matches the `From` address domain. 4. Parent user's default domain. 5. sendgrid.net + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAllAuthenticatedDomainWithUserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**[]ListAllAuthenticatedDomainWithUser200ResponseInner**](ListAllAuthenticatedDomainWithUser200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInner.md b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInner.md new file mode 100644 index 00000000..01be72df --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInner.md @@ -0,0 +1,22 @@ +# ListAllAuthenticatedDomainWithUser200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **float32** | The ID of the authenticated domain. | +**UserId** | **float32** | The ID of the user that this domain is associated with. | +**Subdomain** | **string** | The subdomain to use for this authenticated domain. | +**Domain** | **string** | The domain to be authenticated. | +**Username** | **string** | The username that this domain will be associated with. | +**Ips** | **[]string** | The IPs to be included in the custom SPF record for this authenticated domain. | +**CustomSpf** | **bool** | Indicates whether this authenticated domain uses custom SPF. | +**Default** | **bool** | Indicates if this is the default authenticated domain. | +**Legacy** | **bool** | Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it. | +**AutomaticSecurity** | **bool** | Indicates if this authenticated domain uses automated security. | +**Valid** | **bool** | Indicates if this is a valid authenticated domain. | +**Dns** | [**ListAllAuthenticatedDomainWithUser200ResponseInnerDns**](ListAllAuthenticatedDomainWithUser200ResponseInnerDns.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDns.md b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDns.md new file mode 100644 index 00000000..52d1114c --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDns.md @@ -0,0 +1,13 @@ +# ListAllAuthenticatedDomainWithUser200ResponseInnerDns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MailCname** | [**ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname**](ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname.md) | | +**Dkim1** | [**ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1**](ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1.md) | | +**Dkim2** | [**ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1**](ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1.md b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1.md new file mode 100644 index 00000000..be86cafd --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1.md @@ -0,0 +1,14 @@ +# ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | **bool** | Indicates if this is a valid DNS record. | +**Type** | **string** | The type of DNS record. | +**Host** | **string** | The domain that this DNS record was created for. | +**Data** | **string** | The DNS record. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname.md b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname.md new file mode 100644 index 00000000..f15d047a --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname.md @@ -0,0 +1,14 @@ +# ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | **bool** | Indicates if this is a valid CNAME. | +**Type** | **string** | The type of DNS record. | +**Host** | **string** | The domain that this CNAME is created for. | +**Data** | **string** | The CNAME record. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ListAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/ListAuthenticatedDomain.md new file mode 100644 index 00000000..b8031638 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListAuthenticatedDomain.md @@ -0,0 +1,53 @@ +# ListAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAuthenticatedDomain**](ListAuthenticatedDomain.md#ListAuthenticatedDomain) | **Get** /v3/whitelabel/domains | List all authenticated domains + + + +## ListAuthenticatedDomain + +> []interface{} ListAuthenticatedDomain(ctx, optional) + +List all authenticated domains + +**This endpoint allows you to retrieve a paginated list of all domains you have authenticated.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**ExcludeSubusers** | **bool** | Exclude subuser domains from the result. +**Username** | **string** | The username associated with an authenticated domain. +**Domain** | **string** | Search for authenticated domains. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**[]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/ListAuthenticatedDomainWithUser.md b/rest/api/v3/domain_authentication/docs/ListAuthenticatedDomainWithUser.md new file mode 100644 index 00000000..18628529 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListAuthenticatedDomainWithUser.md @@ -0,0 +1,47 @@ +# ListAuthenticatedDomainWithUser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAuthenticatedDomainWithUser**](ListAuthenticatedDomainWithUser.md#ListAuthenticatedDomainWithUser) | **Get** /v3/whitelabel/domains/subuser | List the authenticated domain associated with the given user. + + + +## ListAuthenticatedDomainWithUser + +> AuthenticatedDomainSpf ListAuthenticatedDomainWithUser(ctx, Username) + +List the authenticated domain associated with the given user. + +**This endpoint allows you to retrieve all of the authenticated domains that have been assigned to a specific subuser.** Authenticated domains can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's domain. To associate an authenticated domain with a subuser, the parent account must first authenticate and validate the domain. The parent may then associate the authenticated domain via the subuser management tools. Note that if you used the [`/v3/whitelabel/domains/{domain_id}/subuser:add` endpoint]( https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/associate-an-authenticated-domain-with-a-subuser-multiple) to add multiple domains to the subuser, you can use the [`/v3/whitelabel/domains/subuser/all` endpoint](https://www.twilio.com/docs/sendgrid/api-reference/domain-authentication/list-the-authenticated-domain-associated-with-a-subuser-multiple) to list those associated domains. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAuthenticatedDomainWithUserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**AuthenticatedDomainSpf**](AuthenticatedDomainSpf.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/ListDefaultAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/ListDefaultAuthenticatedDomain.md new file mode 100644 index 00000000..0c23d724 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ListDefaultAuthenticatedDomain.md @@ -0,0 +1,49 @@ +# ListDefaultAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListDefaultAuthenticatedDomain**](ListDefaultAuthenticatedDomain.md#ListDefaultAuthenticatedDomain) | **Get** /v3/whitelabel/domains/default | Get the default authentication + + + +## ListDefaultAuthenticatedDomain + +> []interface{} ListDefaultAuthenticatedDomain(ctx, optional) + +Get the default authentication + +**This endpoint allows you to retrieve the default authentication for a domain.** When creating or updating a domain authentication, you can set the domain as a default. The default domain will be used to send all mail. If you have multiple authenticated domains, the authenticated domain matching the domain of the From address will be used, and the default will be overridden. This endpoint will return a default domain and its details only if a default is set. You are not required to set a default. If you do not set a default domain, this endpoint will return general information about your domain authentication status. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListDefaultAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Domain** | **string** | The domain to find a default authentication. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**[]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomain.md new file mode 100644 index 00000000..aa6feaad --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomain.md @@ -0,0 +1,53 @@ +# UpdateAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateAuthenticatedDomain**](UpdateAuthenticatedDomain.md#UpdateAuthenticatedDomain) | **Patch** /v3/whitelabel/domains/{DomainId} | Update an authenticated domain + + + +## UpdateAuthenticatedDomain + +> []interface{} UpdateAuthenticatedDomain(ctx, DomainIdoptional) + +Update an authenticated domain + +**This endpoint allows you to update the settings for an authenticated domain.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**DomainId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateAuthenticatedDomainRequest** | [**UpdateAuthenticatedDomainRequest**](UpdateAuthenticatedDomainRequest.md) | + +### Return type + +**[]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomainRequest.md b/rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomainRequest.md new file mode 100644 index 00000000..99eac6b7 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/UpdateAuthenticatedDomainRequest.md @@ -0,0 +1,12 @@ +# UpdateAuthenticatedDomainRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Default** | **bool** | Indicates whether this is the default authenticated domain. |[optional] [default to false] +**CustomSpf** | **bool** | Indicates whether to generate a custom SPF record for manual security. |[optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain.md new file mode 100644 index 00000000..2382aa2a --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain.md @@ -0,0 +1,52 @@ +# ValidateAuthenticatedDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ValidateAuthenticatedDomain**](ValidateAuthenticatedDomain.md#ValidateAuthenticatedDomain) | **Post** /v3/whitelabel/domains/{Id}/validate | Validate a domain authentication. + + + +## ValidateAuthenticatedDomain + +> ValidateAuthenticatedDomain200Response ValidateAuthenticatedDomain(ctx, Idoptional) + +Validate a domain authentication. + +**This endpoint allows you to validate an authenticated domain. If it fails, it will return an error message describing why the domain could not be validated.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | ID of the domain to validate. + +### Other Parameters + +Other parameters are passed through a pointer to a ValidateAuthenticatedDomainParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ValidateAuthenticatedDomain200Response**](ValidateAuthenticatedDomain200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200Response.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200Response.md new file mode 100644 index 00000000..12efc7d9 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200Response.md @@ -0,0 +1,13 @@ +# ValidateAuthenticatedDomain200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the authenticated domain. |[optional] +**Valid** | **bool** | Indicates if this is a valid authenticated domain. |[optional] +**ValidationResults** | [**ValidateAuthenticatedDomain200ResponseValidationResults**](ValidateAuthenticatedDomain200ResponseValidationResults.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResults.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResults.md new file mode 100644 index 00000000..5afcb1d5 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResults.md @@ -0,0 +1,14 @@ +# ValidateAuthenticatedDomain200ResponseValidationResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MailCname** | [**ValidateAuthenticatedDomain200ResponseValidationResultsMailCname**](ValidateAuthenticatedDomain200ResponseValidationResultsMailCname.md) | |[optional] +**Dkim1** | [**ValidateAuthenticatedDomain200ResponseValidationResultsDkim1**](ValidateAuthenticatedDomain200ResponseValidationResultsDkim1.md) | |[optional] +**Dkim2** | [**ValidateAuthenticatedDomain200ResponseValidationResultsDkim1**](ValidateAuthenticatedDomain200ResponseValidationResultsDkim1.md) | |[optional] +**Spf** | [**ValidateAuthenticatedDomain200ResponseValidationResultsSpf**](ValidateAuthenticatedDomain200ResponseValidationResultsSpf.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsDkim1.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsDkim1.md new file mode 100644 index 00000000..48d7eb03 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsDkim1.md @@ -0,0 +1,12 @@ +# ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | **bool** | Indicates if the DNS record is valid. |[optional] +**Reason** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsMailCname.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsMailCname.md new file mode 100644 index 00000000..b87534f9 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsMailCname.md @@ -0,0 +1,12 @@ +# ValidateAuthenticatedDomain200ResponseValidationResultsMailCname + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | **bool** | Indicates if this DNS record is valid. |[optional] +**Reason** | **string** | The reason this record is invalid. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsSpf.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsSpf.md new file mode 100644 index 00000000..12ba1b89 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain200ResponseValidationResultsSpf.md @@ -0,0 +1,12 @@ +# ValidateAuthenticatedDomain200ResponseValidationResultsSpf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | **bool** | Indicates if the SPF record is valid. |[optional] +**Reason** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500Response.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500Response.md new file mode 100644 index 00000000..47da7002 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500Response.md @@ -0,0 +1,11 @@ +# ValidateAuthenticatedDomain500Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ValidateAuthenticatedDomain500ResponseErrorsInner**](ValidateAuthenticatedDomain500ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500ResponseErrorsInner.md b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500ResponseErrorsInner.md new file mode 100644 index 00000000..ddc1de56 --- /dev/null +++ b/rest/api/v3/domain_authentication/docs/ValidateAuthenticatedDomain500ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# ValidateAuthenticatedDomain500ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | A message explaining the reason for the error. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/domain_authentication/model_add_ip_to_authenticated_domain_request.go b/rest/api/v3/domain_authentication/model_add_ip_to_authenticated_domain_request.go new file mode 100644 index 00000000..618ecd41 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_add_ip_to_authenticated_domain_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpToAuthenticatedDomainRequest struct for AddIpToAuthenticatedDomainRequest +type AddIpToAuthenticatedDomainRequest struct { + // IP to associate with the domain. Used for manually specifying IPs for custom SPF. + Ip string `json:"ip"` +} diff --git a/rest/api/v3/domain_authentication/model_associate_subuser_with_domain_request.go b/rest/api/v3/domain_authentication/model_associate_subuser_with_domain_request.go new file mode 100644 index 00000000..46d3898a --- /dev/null +++ b/rest/api/v3/domain_authentication/model_associate_subuser_with_domain_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AssociateSubuserWithDomainRequest struct for AssociateSubuserWithDomainRequest +type AssociateSubuserWithDomainRequest struct { + // Username to associate with the authenticated domain. + Username string `json:"username"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticate_domain_request.go b/rest/api/v3/domain_authentication/model_authenticate_domain_request.go new file mode 100644 index 00000000..1896d15f --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticate_domain_request.go @@ -0,0 +1,36 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticateDomainRequest struct for AuthenticateDomainRequest +type AuthenticateDomainRequest struct { + // Domain being authenticated. + Domain string `json:"domain"` + // The subdomain to use for this authenticated domain. + Subdomain *string `json:"subdomain,omitempty"` + // The username associated with this domain. + Username *string `json:"username,omitempty"` + // The IP addresses that will be included in the custom SPF record for this authenticated domain. + Ips *[]string `json:"ips,omitempty"` + // Specify whether to use a custom SPF or allow SendGrid to manage your SPF. This option is only available to authenticated domains set up for manual security. + CustomSpf *bool `json:"custom_spf,omitempty"` + // Whether to use this authenticated domain as the fallback if no authenticated domains match the sender's domain. + Default *bool `json:"default,omitempty"` + // Whether to allow SendGrid to manage your SPF records, DKIM keys, and DKIM key rotation. + AutomaticSecurity *bool `json:"automatic_security,omitempty"` + // Add a custom DKIM selector. Accepts three letters or numbers. + CustomDkimSelector *string `json:"custom_dkim_selector,omitempty"` + // The region of the domain. Allowed values are `global` and `eu`. The default value is `global`. + Region *string `json:"region,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticated_domain.go b/rest/api/v3/domain_authentication/model_authenticated_domain.go new file mode 100644 index 00000000..1de91ca9 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticated_domain.go @@ -0,0 +1,41 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticatedDomain struct for AuthenticatedDomain +type AuthenticatedDomain struct { + // The ID of the authenticated domain. + Id float32 `json:"id"` + // The ID of the user that this domain is associated with. + UserId float32 `json:"user_id"` + // The subdomain to use for this authenticated domain. + Subdomain string `json:"subdomain"` + // The domain to be authenticated. + Domain string `json:"domain"` + // The username that this domain will be associated with. + Username string `json:"username"` + // The IPs to be included in the custom SPF record for this authenticated domain. + Ips []string `json:"ips"` + // Indicates whether this authenticated domain uses custom SPF. + CustomSpf bool `json:"custom_spf"` + // Indicates if this is the default authenticated domain. + Default bool `json:"default"` + // Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it. + Legacy bool `json:"legacy"` + // Indicates if this authenticated domain uses automated security. + AutomaticSecurity bool `json:"automatic_security"` + // Indicates if this is a valid authenticated domain. + Valid bool `json:"valid"` + Dns ListAllAuthenticatedDomainWithUser200ResponseInnerDns `json:"dns"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticated_domain_spf.go b/rest/api/v3/domain_authentication/model_authenticated_domain_spf.go new file mode 100644 index 00000000..8253d6a7 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticated_domain_spf.go @@ -0,0 +1,41 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticatedDomainSpf struct for AuthenticatedDomainSpf +type AuthenticatedDomainSpf struct { + // The ID of the authenticated domain. + Id int32 `json:"id"` + // The domain authenticated. + Domain string `json:"domain"` + // The subdomain that was used to create this authenticated domain. + Subdomain *string `json:"subdomain,omitempty"` + // The username of the account that this authenticated domain is associated with. + Username string `json:"username"` + // The user_id of the account that this authenticated domain is associated with. + UserId int32 `json:"user_id"` + // The IP addresses that are included in the SPF record for this authenticated domain. + Ips []interface{} `json:"ips"` + // Indicates if this authenticated domain uses custom SPF. + CustomSpf bool `json:"custom_spf"` + // Indicates if this is the default domain. + Default bool `json:"default"` + // Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it. + Legacy bool `json:"legacy"` + // Indicates if this authenticated domain uses automated security. + AutomaticSecurity bool `json:"automatic_security"` + // Indicates if this is a valid authenticated domain . + Valid bool `json:"valid"` + Dns AuthenticatedDomainSpfDns `json:"dns"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns.go b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns.go new file mode 100644 index 00000000..776411ba --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticatedDomainSpfDns The DNS records for this authenticated domain. +type AuthenticatedDomainSpfDns struct { + MailServer AuthenticatedDomainSpfDnsMailServer `json:"mail_server"` + SubdomainSpf AuthenticatedDomainSpfDnsSubdomainSpf `json:"subdomain_spf"` + DomainSpf AuthenticatedDomainSpfDnsDomainSpf `json:"domain_spf"` + Dkim AuthenticatedDomainSpfDnsDkim `json:"dkim"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_dkim.go b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_dkim.go new file mode 100644 index 00000000..e7001397 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_dkim.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticatedDomainSpfDnsDkim The DKIM record for messages sent using this authenticated domain. +type AuthenticatedDomainSpfDnsDkim struct { + // The DNS labels for the DKIM signature. + Host string `json:"host"` + // The type of data in the DKIM record. + Type string `json:"type"` + // The DKIM record. + Data string `json:"data"` + // Indicates if the DKIM record is valid. + Valid bool `json:"valid"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_domain_spf.go b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_domain_spf.go new file mode 100644 index 00000000..4a5499ee --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_domain_spf.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticatedDomainSpfDnsDomainSpf The SPF record for the root domain. +type AuthenticatedDomainSpfDnsDomainSpf struct { + // The root domain that this SPF record will be used to authenticate. + Host string `json:"host"` + // The type of data in the SPF record. + Type string `json:"type"` + // The SPF record. + Data string `json:"data"` + // Indicates if the SPF record is valid. + Valid bool `json:"valid"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_mail_server.go b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_mail_server.go new file mode 100644 index 00000000..cd48d541 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_mail_server.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticatedDomainSpfDnsMailServer Designates which mail server is responsible for accepting messages from a domain. +type AuthenticatedDomainSpfDnsMailServer struct { + // The domain sending the messages. + Host string `json:"host"` + // They type of DNS record. + Type string `json:"type"` + // The mail server responsible for accepting messages from the sending domain. + Data string `json:"data"` + // Indicates if this is a valid DNS record. + Valid bool `json:"valid"` +} diff --git a/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_subdomain_spf.go b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_subdomain_spf.go new file mode 100644 index 00000000..9b298d28 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_authenticated_domain_spf_dns_subdomain_spf.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AuthenticatedDomainSpfDnsSubdomainSpf The SPF record for the subdomain used to create this authenticated domain. +type AuthenticatedDomainSpfDnsSubdomainSpf struct { + // The domain that this SPF record will be used to authenticate. + Host string `json:"host"` + // The type of data in the SPF record. + Type string `json:"type"` + // The SPF record. + Data string `json:"data"` + // Indicates if this is a valid SPF record. + Valid bool `json:"valid"` +} diff --git a/rest/api/v3/domain_authentication/model_email_dns_record_400_response.go b/rest/api/v3/domain_authentication/model_email_dns_record_400_response.go new file mode 100644 index 00000000..5c9bd4d1 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_email_dns_record_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EmailDnsRecord400Response struct for EmailDnsRecord400Response +type EmailDnsRecord400Response struct { + Errors *EmailDnsRecord400ResponseErrors `json:"errors,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_email_dns_record_400_response_errors.go b/rest/api/v3/domain_authentication/model_email_dns_record_400_response_errors.go new file mode 100644 index 00000000..b694a199 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_email_dns_record_400_response_errors.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EmailDnsRecord400ResponseErrors struct for EmailDnsRecord400ResponseErrors +type EmailDnsRecord400ResponseErrors struct { + Error *string `json:"error,omitempty"` + Field *string `json:"field,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_email_dns_record_request.go b/rest/api/v3/domain_authentication/model_email_dns_record_request.go new file mode 100644 index 00000000..f8ddf111 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_email_dns_record_request.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EmailDnsRecordRequest struct for EmailDnsRecordRequest +type EmailDnsRecordRequest struct { + // The ID of the branded link. + LinkId int32 `json:"link_id"` + // The ID of your SendGrid domain record. + DomainId int32 `json:"domain_id"` + // The email address to send the DNS information to. + Email string `json:"email"` + // A custom text block to include in the email body sent with the records. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner.go b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner.go new file mode 100644 index 00000000..ffc38779 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner.go @@ -0,0 +1,41 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAllAuthenticatedDomainWithUser200ResponseInner struct for ListAllAuthenticatedDomainWithUser200ResponseInner +type ListAllAuthenticatedDomainWithUser200ResponseInner struct { + // The ID of the authenticated domain. + Id float32 `json:"id"` + // The ID of the user that this domain is associated with. + UserId float32 `json:"user_id"` + // The subdomain to use for this authenticated domain. + Subdomain string `json:"subdomain"` + // The domain to be authenticated. + Domain string `json:"domain"` + // The username that this domain will be associated with. + Username string `json:"username"` + // The IPs to be included in the custom SPF record for this authenticated domain. + Ips []string `json:"ips"` + // Indicates whether this authenticated domain uses custom SPF. + CustomSpf bool `json:"custom_spf"` + // Indicates if this is the default authenticated domain. + Default bool `json:"default"` + // Indicates if this authenticated domain was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new authenticated domain if you need to update it. + Legacy bool `json:"legacy"` + // Indicates if this authenticated domain uses automated security. + AutomaticSecurity bool `json:"automatic_security"` + // Indicates if this is a valid authenticated domain. + Valid bool `json:"valid"` + Dns ListAllAuthenticatedDomainWithUser200ResponseInnerDns `json:"dns"` +} diff --git a/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns.go b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns.go new file mode 100644 index 00000000..4d4066b6 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAllAuthenticatedDomainWithUser200ResponseInnerDns The DNS records used to authenticate the sending domain. +type ListAllAuthenticatedDomainWithUser200ResponseInnerDns struct { + MailCname ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname `json:"mail_cname"` + Dkim1 ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 `json:"dkim1"` + Dkim2 ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 `json:"dkim2"` +} diff --git a/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_dkim1.go b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_dkim1.go new file mode 100644 index 00000000..527e6c15 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_dkim1.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 A DNS record. +type ListAllAuthenticatedDomainWithUser200ResponseInnerDnsDkim1 struct { + // Indicates if this is a valid DNS record. + Valid bool `json:"valid"` + // The type of DNS record. + Type string `json:"type"` + // The domain that this DNS record was created for. + Host string `json:"host"` + // The DNS record. + Data string `json:"data"` +} diff --git a/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_mail_cname.go b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_mail_cname.go new file mode 100644 index 00000000..fe6f1868 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_list_all_authenticated_domain_with_user_200_response_inner_dns_mail_cname.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname The CNAME for your sending domain that points to sendgrid.net. +type ListAllAuthenticatedDomainWithUser200ResponseInnerDnsMailCname struct { + // Indicates if this is a valid CNAME. + Valid bool `json:"valid"` + // The type of DNS record. + Type string `json:"type"` + // The domain that this CNAME is created for. + Host string `json:"host"` + // The CNAME record. + Data string `json:"data"` +} diff --git a/rest/api/v3/domain_authentication/model_update_authenticated_domain_request.go b/rest/api/v3/domain_authentication/model_update_authenticated_domain_request.go new file mode 100644 index 00000000..37075169 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_update_authenticated_domain_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateAuthenticatedDomainRequest struct for UpdateAuthenticatedDomainRequest +type UpdateAuthenticatedDomainRequest struct { + // Indicates whether this is the default authenticated domain. + Default *bool `json:"default,omitempty"` + // Indicates whether to generate a custom SPF record for manual security. + CustomSpf *bool `json:"custom_spf,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response.go b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response.go new file mode 100644 index 00000000..8d90293f --- /dev/null +++ b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateAuthenticatedDomain200Response struct for ValidateAuthenticatedDomain200Response +type ValidateAuthenticatedDomain200Response struct { + // The ID of the authenticated domain. + Id *int32 `json:"id,omitempty"` + // Indicates if this is a valid authenticated domain. + Valid *bool `json:"valid,omitempty"` + ValidationResults *ValidateAuthenticatedDomain200ResponseValidationResults `json:"validation_results,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results.go b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results.go new file mode 100644 index 00000000..127ec9c9 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateAuthenticatedDomain200ResponseValidationResults The individual DNS records that are checked when validating, including the reason for any invalid DNS records. +type ValidateAuthenticatedDomain200ResponseValidationResults struct { + MailCname *ValidateAuthenticatedDomain200ResponseValidationResultsMailCname `json:"mail_cname,omitempty"` + Dkim1 *ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 `json:"dkim1,omitempty"` + Dkim2 *ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 `json:"dkim2,omitempty"` + Spf *ValidateAuthenticatedDomain200ResponseValidationResultsSpf `json:"spf,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_dkim1.go b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_dkim1.go new file mode 100644 index 00000000..9a8df2e2 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_dkim1.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 A DNS record for this authenticated domain. +type ValidateAuthenticatedDomain200ResponseValidationResultsDkim1 struct { + // Indicates if the DNS record is valid. + Valid *bool `json:"valid,omitempty"` + Reason *string `json:"reason,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_mail_cname.go b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_mail_cname.go new file mode 100644 index 00000000..d7664480 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_mail_cname.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateAuthenticatedDomain200ResponseValidationResultsMailCname The CNAME record for the authenticated domain. +type ValidateAuthenticatedDomain200ResponseValidationResultsMailCname struct { + // Indicates if this DNS record is valid. + Valid *bool `json:"valid,omitempty"` + // The reason this record is invalid. + Reason *string `json:"reason,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_spf.go b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_spf.go new file mode 100644 index 00000000..1505eba8 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_200_response_validation_results_spf.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateAuthenticatedDomain200ResponseValidationResultsSpf The SPF record for the authenticated domain. +type ValidateAuthenticatedDomain200ResponseValidationResultsSpf struct { + // Indicates if the SPF record is valid. + Valid *bool `json:"valid,omitempty"` + Reason *string `json:"reason,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response.go b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response.go new file mode 100644 index 00000000..d3f70be7 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateAuthenticatedDomain500Response struct for ValidateAuthenticatedDomain500Response +type ValidateAuthenticatedDomain500Response struct { + Errors *[]ValidateAuthenticatedDomain500ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response_errors_inner.go b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response_errors_inner.go new file mode 100644 index 00000000..fc47a4c6 --- /dev/null +++ b/rest/api/v3/domain_authentication/model_validate_authenticated_domain_500_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Domain Authentication API +* The Twilio SendGrid Domain Authentication API allows you to manage your authenticated domains and their settings. Domain Authentication is a required step when setting up your Twilio SendGrid account because it's essential to ensuring the deliverability of your email. Domain Authentication signals trustworthiness to email inbox providers and your recipients by approving SendGrid to send email on behalf of your domain. For more information, see [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/). Each user may have a maximum of 3,000 authenticated domains and 3,000 link brandings. This limit is at the user level, meaning each Subuser belonging to a parent account may have its own 3,000 authenticated domains and 3,000 link brandings. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateAuthenticatedDomain500ResponseErrorsInner struct for ValidateAuthenticatedDomain500ResponseErrorsInner +type ValidateAuthenticatedDomain500ResponseErrorsInner struct { + // A message explaining the reason for the error. + Message string `json:"message"` +} diff --git a/rest/api/v3/email_activity/README.md b/rest/api/v3/email_activity/README.md new file mode 100644 index 00000000..de11c476 --- /dev/null +++ b/rest/api/v3/email_activity/README.md @@ -0,0 +1,89 @@ +# Go API client for + +The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. + +You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. + +See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.497877+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DownloadCsv* | [**DownloadCsv**](docs/DownloadCsv.md#downloadcsv) | **Get** /v3/messages/download/{DownloadUuid} | Download CSV +*GetMessage* | [**GetMessage**](docs/GetMessage.md#getmessage) | **Get** /v3/messages/{MsgId} | Filter messages by message ID +*ListMessage* | [**ListMessage**](docs/ListMessage.md#listmessage) | **Get** /v3/messages | Filter all messages +*RequestCsv* | [**RequestCsv**](docs/RequestCsv.md#requestcsv) | **Post** /v3/messages/download | Request CSV + + +## Documentation For Models + + - [AbbvMessage](AbbvMessage.md) + - [BounceType](BounceType.md) + - [BounceType1](BounceType1.md) + - [DownloadCsv200Response](DownloadCsv200Response.md) + - [EmailActivityResponseBaseProps](EmailActivityResponseBaseProps.md) + - [Event](Event.md) + - [EventName](EventName.md) + - [EventName1](EventName1.md) + - [GetMessage404Response](GetMessage404Response.md) + - [GetMessage404ResponseErrorsInner](GetMessage404ResponseErrorsInner.md) + - [ListMessage200Response](ListMessage200Response.md) + - [ListMessage400Response](ListMessage400Response.md) + - [ListMessage400ResponseErrorsInner](ListMessage400ResponseErrorsInner.md) + - [ListMessage429Response](ListMessage429Response.md) + - [ListMessage429ResponseErrorsInner](ListMessage429ResponseErrorsInner.md) + - [Message](Message.md) + - [OutboundIpType](OutboundIpType.md) + - [OutboundIpType1](OutboundIpType1.md) + - [RequestCsv202Response](RequestCsv202Response.md) + - [Status](Status.md) + - [Status1](Status1.md) + - [Status2](Status2.md) + - [Status3](Status3.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/email_activity/api_download_csv.go b/rest/api/v3/email_activity/api_download_csv.go new file mode 100644 index 00000000..4490e27a --- /dev/null +++ b/rest/api/v3/email_activity/api_download_csv.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DownloadCsvParam struct { + // UUID used to locate the download csv request entry in the DB. This is the UUID provided in the email sent to the user when their csv file is ready to download + DownloadUuid *string `json:"download_uuid"` +} + +func (params *DownloadCsvParam) SetDownloadUuid(DownloadUuid string) *DownloadCsvParam { + params.DownloadUuid = &DownloadUuid + return params +} + +// **This endpoint will return a presigned URL that can be used to download the CSV that was requested from the \"Request a CSV\" endpoint.** +func (c *ApiService) DownloadCsv(params *DownloadCsvParam) (interface{}, error) { + path := "/v3/messages/download/{DownloadUuid}" + if params != nil && params.DownloadUuid != nil { + path = strings.Replace(path, "{"+"DownloadUuid"+"}", *params.DownloadUuid, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DownloadCsv200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_activity/api_get_message.go b/rest/api/v3/email_activity/api_get_message.go new file mode 100644 index 00000000..e94cfae4 --- /dev/null +++ b/rest/api/v3/email_activity/api_get_message.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetMessageParam struct { + // The ID of the message you are requesting details for. + MsgId *string `json:"msg_id"` +} + +func (params *GetMessageParam) SetMsgId(MsgId string) *GetMessageParam { + params.MsgId = &MsgId + return params +} + +// Get all of the details about the specified message. +func (c *ApiService) GetMessage(params *GetMessageParam) (interface{}, error) { + path := "/v3/messages/{MsgId}" + if params != nil && params.MsgId != nil { + path = strings.Replace(path, "{"+"MsgId"+"}", *params.MsgId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Message{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetMessage404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_activity/api_list_message.go b/rest/api/v3/email_activity/api_list_message.go new file mode 100644 index 00000000..ccb93840 --- /dev/null +++ b/rest/api/v3/email_activity/api_list_message.go @@ -0,0 +1,86 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListMessageParam struct { + // Use the query syntax to filter your email activity. + Query *string `json:"query"` + // The number of messages returned. This parameter must be greater than 0 and less than or equal to 1000 + Limit *float32 `json:"limit,omitempty"` +} + +func (params *ListMessageParam) SetQuery(Query string) *ListMessageParam { + params.Query = &Query + return params +} +func (params *ListMessageParam) SetLimit(Limit float32) *ListMessageParam { + params.Limit = &Limit + return params +} + +// Filter all messages to search your Email Activity. All queries must be [URL encoded](https://meyerweb.com/eric/tools/dencoder/), and use the following format: `query={query_type}=\"{query_content}\"` Once URL encoded, the previous query will look like this: `query=type%3D%22query_content%22` For example, to filter by a specific email, use the following query: `query=to_email%3D%22example%40example.com%22` Visit our [Query Reference section](https://docs.sendgrid.com/for-developers/sending-email/getting-started-email-activity-api#query-reference) to see a full list of basic query types and examples. +func (c *ApiService) ListMessage(params *ListMessageParam) (interface{}, error) { + path := "/v3/messages" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Query != nil { + data.Set("query", *params.Query) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListMessage200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListMessage400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_activity/api_request_csv.go b/rest/api/v3/email_activity/api_request_csv.go new file mode 100644 index 00000000..0cb265cf --- /dev/null +++ b/rest/api/v3/email_activity/api_request_csv.go @@ -0,0 +1,84 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type RequestCsvParam struct { + // Uses a SQL like syntax to indicate which messages to include in the CSV + Query *string `json:"query,omitempty"` +} + +func (params *RequestCsvParam) SetQuery(Query string) *RequestCsvParam { + params.Query = &Query + return params +} + +// This request will kick off a backend process to generate a CSV file. Once generated, the worker will then send an email for the user download the file. The link will expire in 3 days. The CSV will contain the events from the last 30 days, limited to the last 1 million events maximum. This endpoint will be rate limited to 1 request every 12 hours (rate limit may change). This endpoint is similar to the GET Single Message endpoint - the only difference is that /download is added to indicate that this is a CSV download requests but the same query is used to determine what the CSV should contain. +func (c *ApiService) RequestCsv(params *RequestCsvParam) (interface{}, error) { + path := "/v3/messages/download" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Query != nil { + data.Set("query", *params.Query) + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &RequestCsv202Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListMessage429Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_activity/api_service.go b/rest/api/v3/email_activity/api_service.go new file mode 100644 index 00000000..9a929e14 --- /dev/null +++ b/rest/api/v3/email_activity/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/email_activity/docs/AbbvMessage.md b/rest/api/v3/email_activity/docs/AbbvMessage.md new file mode 100644 index 00000000..d5eb580e --- /dev/null +++ b/rest/api/v3/email_activity/docs/AbbvMessage.md @@ -0,0 +1,18 @@ +# AbbvMessage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FromEmail** | **string** | | +**MsgId** | **string** | | +**Subject** | **string** | | +**ToEmail** | **string** | | +**Status** | [**Status**](Status.md) | | +**OpensCount** | **int32** | | +**ClicksCount** | **int32** | | +**LastEventTime** | **string** | iso 8601 format | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/BounceType.md b/rest/api/v3/email_activity/docs/BounceType.md new file mode 100644 index 00000000..d419a200 --- /dev/null +++ b/rest/api/v3/email_activity/docs/BounceType.md @@ -0,0 +1,13 @@ +# BounceType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SOFT** | string | (value: `"soft"`) +**HARD** | string | (value: `"hard"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/BounceType1.md b/rest/api/v3/email_activity/docs/BounceType1.md new file mode 100644 index 00000000..6c717285 --- /dev/null +++ b/rest/api/v3/email_activity/docs/BounceType1.md @@ -0,0 +1,13 @@ +# BounceType1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SOFT** | string | (value: `"soft"`) +**HARD** | string | (value: `"hard"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/DownloadCsv.md b/rest/api/v3/email_activity/docs/DownloadCsv.md new file mode 100644 index 00000000..e53ea921 --- /dev/null +++ b/rest/api/v3/email_activity/docs/DownloadCsv.md @@ -0,0 +1,51 @@ +# DownloadCsv + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DownloadCsv**](DownloadCsv.md#DownloadCsv) | **Get** /v3/messages/download/{DownloadUuid} | Download CSV + + + +## DownloadCsv + +> DownloadCsv200Response DownloadCsv(ctx, DownloadUuid) + +Download CSV + +**This endpoint will return a presigned URL that can be used to download the CSV that was requested from the \"Request a CSV\" endpoint.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**DownloadUuid** | **string** | UUID used to locate the download csv request entry in the DB. This is the UUID provided in the email sent to the user when their csv file is ready to download + +### Other Parameters + +Other parameters are passed through a pointer to a DownloadCsvParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**DownloadCsv200Response**](DownloadCsv200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_activity/docs/DownloadCsv200Response.md b/rest/api/v3/email_activity/docs/DownloadCsv200Response.md new file mode 100644 index 00000000..5a2abcc5 --- /dev/null +++ b/rest/api/v3/email_activity/docs/DownloadCsv200Response.md @@ -0,0 +1,12 @@ +# DownloadCsv200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PresignedUrl** | **string** | A signed link that will allow you to download the CSV file requested by the Request a CSV endpoint. |[optional] +**Csv** | **string** | Returns the aws signed link to the csv file which mako UI should perform a get on to trigger the csv download for the user | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/EmailActivityResponseBaseProps.md b/rest/api/v3/email_activity/docs/EmailActivityResponseBaseProps.md new file mode 100644 index 00000000..9a6546f4 --- /dev/null +++ b/rest/api/v3/email_activity/docs/EmailActivityResponseBaseProps.md @@ -0,0 +1,15 @@ +# EmailActivityResponseBaseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FromEmail** | **string** | The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account. |[optional] [default to "test0@example.com"] +**MsgId** | **string** | A unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message. |[optional] +**Subject** | **string** | The email's subject line. |[optional] +**ToEmail** | **string** | The intended recipient's email address. |[optional] +**Status** | [**Status3**](Status3.md) | The message's status. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/Event.md b/rest/api/v3/email_activity/docs/Event.md new file mode 100644 index 00000000..78e02233 --- /dev/null +++ b/rest/api/v3/email_activity/docs/Event.md @@ -0,0 +1,18 @@ +# Event + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EventName** | [**EventName**](EventName.md) | Name of event | +**Processed** | **string** | The date when the event was processed | +**Reason** | **string** | Explanation of what caused the message to be \"bounced\", \"deferred\", or \"blocked\". Usually contains error message from the server - e.g. message from gmail why mail was deferred. |[optional] +**AttemptNum** | **int32** | Used with \"deferred\" events to indicate the attempt number out of 10. One \"deferred\" entry will exists under events array for each time a message was deferred with error message from the server. |[optional] +**Url** | **string** | Used with \"clicked\" event to indicate which url the user clicked. |[optional] +**BounceType** | [**BounceType**](BounceType.md) | Use to distinguish between types of bounces | +**HttpUserAgent** | **string** | Client recipient used to click or open message | +**MxServer** | **string** | The MX server that received the email. For example, mx.gmail.com | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/EventName.md b/rest/api/v3/email_activity/docs/EventName.md new file mode 100644 index 00000000..fc3500e5 --- /dev/null +++ b/rest/api/v3/email_activity/docs/EventName.md @@ -0,0 +1,22 @@ +# EventName + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**BOUNCED** | string | (value: `"bounced"`) +**OPENED** | string | (value: `"opened"`) +**CLICKED** | string | (value: `"clicked"`) +**PROCESSED** | string | (value: `"processed"`) +**DROPPED** | string | (value: `"dropped"`) +**DELIVERED** | string | (value: `"delivered"`) +**DEFERRED** | string | (value: `"deferred"`) +**SPAM_REPORT** | string | (value: `"spam_report"`) +**UNSUBSCRIBE** | string | (value: `"unsubscribe"`) +**GROUP_UNSUBSCRIBE** | string | (value: `"group_unsubscribe"`) +**GROUP_RESUBSCRIBE** | string | (value: `"group_resubscribe"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/EventName1.md b/rest/api/v3/email_activity/docs/EventName1.md new file mode 100644 index 00000000..32f92dff --- /dev/null +++ b/rest/api/v3/email_activity/docs/EventName1.md @@ -0,0 +1,22 @@ +# EventName1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**BOUNCED** | string | (value: `"bounced"`) +**OPENED** | string | (value: `"opened"`) +**CLICKED** | string | (value: `"clicked"`) +**PROCESSED** | string | (value: `"processed"`) +**DROPPED** | string | (value: `"dropped"`) +**DELIVERED** | string | (value: `"delivered"`) +**DEFERRED** | string | (value: `"deferred"`) +**SPAM_REPORT** | string | (value: `"spam_report"`) +**UNSUBSCRIBE** | string | (value: `"unsubscribe"`) +**GROUP_UNSUBSCRIBE** | string | (value: `"group_unsubscribe"`) +**GROUP_RESUBSCRIBE** | string | (value: `"group_resubscribe"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/GetMessage.md b/rest/api/v3/email_activity/docs/GetMessage.md new file mode 100644 index 00000000..aa7a5818 --- /dev/null +++ b/rest/api/v3/email_activity/docs/GetMessage.md @@ -0,0 +1,51 @@ +# GetMessage + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetMessage**](GetMessage.md#GetMessage) | **Get** /v3/messages/{MsgId} | Filter messages by message ID + + + +## GetMessage + +> Message GetMessage(ctx, MsgId) + +Filter messages by message ID + +Get all of the details about the specified message. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**MsgId** | **string** | The ID of the message you are requesting details for. + +### Other Parameters + +Other parameters are passed through a pointer to a GetMessageParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**Message**](Message.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_activity/docs/GetMessage404Response.md b/rest/api/v3/email_activity/docs/GetMessage404Response.md new file mode 100644 index 00000000..488a3b4d --- /dev/null +++ b/rest/api/v3/email_activity/docs/GetMessage404Response.md @@ -0,0 +1,11 @@ +# GetMessage404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]GetMessage404ResponseErrorsInner**](GetMessage404ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/GetMessage404ResponseErrorsInner.md b/rest/api/v3/email_activity/docs/GetMessage404ResponseErrorsInner.md new file mode 100644 index 00000000..fd1ec1f1 --- /dev/null +++ b/rest/api/v3/email_activity/docs/GetMessage404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# GetMessage404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**Field** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/ListMessage.md b/rest/api/v3/email_activity/docs/ListMessage.md new file mode 100644 index 00000000..e2438fc5 --- /dev/null +++ b/rest/api/v3/email_activity/docs/ListMessage.md @@ -0,0 +1,48 @@ +# ListMessage + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListMessage**](ListMessage.md#ListMessage) | **Get** /v3/messages | Filter all messages + + + +## ListMessage + +> ListMessage200Response ListMessage(ctx, Queryoptional) + +Filter all messages + +Filter all messages to search your Email Activity. All queries must be [URL encoded](https://meyerweb.com/eric/tools/dencoder/), and use the following format: `query={query_type}=\"{query_content}\"` Once URL encoded, the previous query will look like this: `query=type%3D%22query_content%22` For example, to filter by a specific email, use the following query: `query=to_email%3D%22example%40example.com%22` Visit our [Query Reference section](https://docs.sendgrid.com/for-developers/sending-email/getting-started-email-activity-api#query-reference) to see a full list of basic query types and examples. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListMessageParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **float32** | The number of messages returned. This parameter must be greater than 0 and less than or equal to 1000 + +### Return type + +[**ListMessage200Response**](ListMessage200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_activity/docs/ListMessage200Response.md b/rest/api/v3/email_activity/docs/ListMessage200Response.md new file mode 100644 index 00000000..4c8b0b60 --- /dev/null +++ b/rest/api/v3/email_activity/docs/ListMessage200Response.md @@ -0,0 +1,11 @@ +# ListMessage200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Messages** | [**[]AbbvMessage**](AbbvMessage.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/ListMessage400Response.md b/rest/api/v3/email_activity/docs/ListMessage400Response.md new file mode 100644 index 00000000..66b20996 --- /dev/null +++ b/rest/api/v3/email_activity/docs/ListMessage400Response.md @@ -0,0 +1,11 @@ +# ListMessage400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListMessage400ResponseErrorsInner**](ListMessage400ResponseErrorsInner.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/ListMessage400ResponseErrorsInner.md b/rest/api/v3/email_activity/docs/ListMessage400ResponseErrorsInner.md new file mode 100644 index 00000000..f75aa149 --- /dev/null +++ b/rest/api/v3/email_activity/docs/ListMessage400ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# ListMessage400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/ListMessage429Response.md b/rest/api/v3/email_activity/docs/ListMessage429Response.md new file mode 100644 index 00000000..5f0af5e3 --- /dev/null +++ b/rest/api/v3/email_activity/docs/ListMessage429Response.md @@ -0,0 +1,11 @@ +# ListMessage429Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListMessage429ResponseErrorsInner**](ListMessage429ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/ListMessage429ResponseErrorsInner.md b/rest/api/v3/email_activity/docs/ListMessage429ResponseErrorsInner.md new file mode 100644 index 00000000..14d3e696 --- /dev/null +++ b/rest/api/v3/email_activity/docs/ListMessage429ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# ListMessage429ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/Message.md b/rest/api/v3/email_activity/docs/Message.md new file mode 100644 index 00000000..db81f245 --- /dev/null +++ b/rest/api/v3/email_activity/docs/Message.md @@ -0,0 +1,25 @@ +# Message + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FromEmail** | **string** | The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account. |[optional] [default to "test0@example.com"] +**MsgId** | **string** | A unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message. |[optional] +**Subject** | **string** | The email's subject line. |[optional] +**ToEmail** | **string** | The intended recipient's email address. |[optional] +**Status** | [**Status3**](Status3.md) | The message's status. |[optional] +**TemplateId** | **string** | The ID associated with a Twilio SendGrid email template used to format the message. | +**AsmGroupId** | **int32** | The unsubscribe group associated with this email. | +**Teammate** | **string** | Teammate's username | +**ApiKeyId** | **string** | The ID of the API Key used to authenticate the sending request for the message. | +**Events** | [**[]Event**](Event.md) | List of events related to email message | +**OriginatingIp** | **string** | This is the IP of the user who sent the message. | +**Categories** | **[]string** | Categories users associated to the message | +**UniqueArgs** | **string** | JSON hash of key-value pairs associated with the message. |[default to "Null"] +**OutboundIp** | **string** | IP used to send to the remote Mail Transfer Agent. | +**OutboundIpType** | [**OutboundIpType**](OutboundIpType.md) | Whether or not the outbound IP is dedicated vs shared | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/OutboundIpType.md b/rest/api/v3/email_activity/docs/OutboundIpType.md new file mode 100644 index 00000000..0b59274a --- /dev/null +++ b/rest/api/v3/email_activity/docs/OutboundIpType.md @@ -0,0 +1,13 @@ +# OutboundIpType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DEDICATED** | string | (value: `"dedicated"`) +**SHARED** | string | (value: `"shared"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/OutboundIpType1.md b/rest/api/v3/email_activity/docs/OutboundIpType1.md new file mode 100644 index 00000000..e6261498 --- /dev/null +++ b/rest/api/v3/email_activity/docs/OutboundIpType1.md @@ -0,0 +1,13 @@ +# OutboundIpType1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DEDICATED** | string | (value: `"dedicated"`) +**SHARED** | string | (value: `"shared"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/RequestCsv.md b/rest/api/v3/email_activity/docs/RequestCsv.md new file mode 100644 index 00000000..c18ac4b3 --- /dev/null +++ b/rest/api/v3/email_activity/docs/RequestCsv.md @@ -0,0 +1,48 @@ +# RequestCsv + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RequestCsv**](RequestCsv.md#RequestCsv) | **Post** /v3/messages/download | Request CSV + + + +## RequestCsv + +> RequestCsv202Response RequestCsv(ctx, optional) + +Request CSV + +This request will kick off a backend process to generate a CSV file. Once generated, the worker will then send an email for the user download the file. The link will expire in 3 days. The CSV will contain the events from the last 30 days, limited to the last 1 million events maximum. This endpoint will be rate limited to 1 request every 12 hours (rate limit may change). This endpoint is similar to the GET Single Message endpoint - the only difference is that /download is added to indicate that this is a CSV download requests but the same query is used to determine what the CSV should contain. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a RequestCsvParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Query** | **string** | Uses a SQL like syntax to indicate which messages to include in the CSV + +### Return type + +[**RequestCsv202Response**](RequestCsv202Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_activity/docs/RequestCsv202Response.md b/rest/api/v3/email_activity/docs/RequestCsv202Response.md new file mode 100644 index 00000000..04c55510 --- /dev/null +++ b/rest/api/v3/email_activity/docs/RequestCsv202Response.md @@ -0,0 +1,12 @@ +# RequestCsv202Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | [**Status2**](Status2.md) | |[optional] +**Message** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/Status.md b/rest/api/v3/email_activity/docs/Status.md new file mode 100644 index 00000000..9c0176ea --- /dev/null +++ b/rest/api/v3/email_activity/docs/Status.md @@ -0,0 +1,14 @@ +# Status + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PROCESSED** | string | (value: `"processed"`) +**DELIVERED** | string | (value: `"delivered"`) +**NOT_DELIVERED** | string | (value: `"not_delivered"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/Status1.md b/rest/api/v3/email_activity/docs/Status1.md new file mode 100644 index 00000000..835d5e5c --- /dev/null +++ b/rest/api/v3/email_activity/docs/Status1.md @@ -0,0 +1,14 @@ +# Status1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PROCESSED** | string | (value: `"processed"`) +**NOT_DELIVERED** | string | (value: `"not_delivered"`) +**DELIVERED** | string | (value: `"delivered"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/Status2.md b/rest/api/v3/email_activity/docs/Status2.md new file mode 100644 index 00000000..35da3328 --- /dev/null +++ b/rest/api/v3/email_activity/docs/Status2.md @@ -0,0 +1,12 @@ +# Status2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PENDING** | string | (value: `"pending"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/docs/Status3.md b/rest/api/v3/email_activity/docs/Status3.md new file mode 100644 index 00000000..0cccb107 --- /dev/null +++ b/rest/api/v3/email_activity/docs/Status3.md @@ -0,0 +1,14 @@ +# Status3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PROCESSED** | string | (value: `"processed"`) +**DELIVERED** | string | (value: `"delivered"`) +**NOT_DELIVERED** | string | (value: `"not_delivered"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_activity/model_abbv__message.go b/rest/api/v3/email_activity/model_abbv__message.go new file mode 100644 index 00000000..11ab95ae --- /dev/null +++ b/rest/api/v3/email_activity/model_abbv__message.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AbbvMessage struct for AbbvMessage +type AbbvMessage struct { + FromEmail string `json:"from_email"` + MsgId string `json:"msg_id"` + Subject string `json:"subject"` + ToEmail string `json:"to_email"` + Status Status `json:"status"` + OpensCount int32 `json:"opens_count"` + ClicksCount int32 `json:"clicks_count"` + // iso 8601 format + LastEventTime string `json:"last_event_time"` +} diff --git a/rest/api/v3/email_activity/model_bounce_type.go b/rest/api/v3/email_activity/model_bounce_type.go new file mode 100644 index 00000000..76c31a7f --- /dev/null +++ b/rest/api/v3/email_activity/model_bounce_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// BounceType the model 'BounceType' +type BounceType string + +// List of BounceType +const ( + BOUNCETYPE_SOFT BounceType = "soft" + BOUNCETYPE_HARD BounceType = "hard" +) diff --git a/rest/api/v3/email_activity/model_bounce_type1.go b/rest/api/v3/email_activity/model_bounce_type1.go new file mode 100644 index 00000000..a9c49152 --- /dev/null +++ b/rest/api/v3/email_activity/model_bounce_type1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// BounceType1 the model 'BounceType1' +type BounceType1 string + +// List of BounceType1 +const ( + BOUNCETYPE1_SOFT BounceType1 = "soft" + BOUNCETYPE1_HARD BounceType1 = "hard" +) diff --git a/rest/api/v3/email_activity/model_download_csv_200_response.go b/rest/api/v3/email_activity/model_download_csv_200_response.go new file mode 100644 index 00000000..ee65ebd8 --- /dev/null +++ b/rest/api/v3/email_activity/model_download_csv_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DownloadCsv200Response struct for DownloadCsv200Response +type DownloadCsv200Response struct { + // A signed link that will allow you to download the CSV file requested by the Request a CSV endpoint. + PresignedUrl *string `json:"presigned_url,omitempty"` + // Returns the aws signed link to the csv file which mako UI should perform a get on to trigger the csv download for the user + Csv string `json:"csv"` +} diff --git a/rest/api/v3/email_activity/model_email_activity_response_base_props.go b/rest/api/v3/email_activity/model_email_activity_response_base_props.go new file mode 100644 index 00000000..3de2c61d --- /dev/null +++ b/rest/api/v3/email_activity/model_email_activity_response_base_props.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EmailActivityResponseBaseProps struct for EmailActivityResponseBaseProps +type EmailActivityResponseBaseProps struct { + // The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account. + FromEmail *string `json:"from_email,omitempty"` + // A unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message. + MsgId *string `json:"msg_id,omitempty"` + // The email's subject line. + Subject *string `json:"subject,omitempty"` + // The intended recipient's email address. + ToEmail *string `json:"to_email,omitempty"` + // The message's status. + Status *Status3 `json:"status,omitempty"` +} diff --git a/rest/api/v3/email_activity/model_event.go b/rest/api/v3/email_activity/model_event.go new file mode 100644 index 00000000..1353170d --- /dev/null +++ b/rest/api/v3/email_activity/model_event.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Event struct for Event +type Event struct { + // Name of event + EventName EventName `json:"event_name"` + // The date when the event was processed + Processed string `json:"processed"` + // Explanation of what caused the message to be \"bounced\", \"deferred\", or \"blocked\". Usually contains error message from the server - e.g. message from gmail why mail was deferred. + Reason *string `json:"reason,omitempty"` + // Used with \"deferred\" events to indicate the attempt number out of 10. One \"deferred\" entry will exists under events array for each time a message was deferred with error message from the server. + AttemptNum *int32 `json:"attempt_num,omitempty"` + // Used with \"clicked\" event to indicate which url the user clicked. + Url *string `json:"url,omitempty"` + // Use to distinguish between types of bounces + BounceType BounceType `json:"bounce_type"` + // Client recipient used to click or open message + HttpUserAgent string `json:"http_user_agent"` + // The MX server that received the email. For example, mx.gmail.com + MxServer string `json:"mx_server"` +} diff --git a/rest/api/v3/email_activity/model_event_name.go b/rest/api/v3/email_activity/model_event_name.go new file mode 100644 index 00000000..0756869a --- /dev/null +++ b/rest/api/v3/email_activity/model_event_name.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventName the model 'EventName' +type EventName string + +// List of EventName +const ( + EVENTNAME_BOUNCED EventName = "bounced" + EVENTNAME_OPENED EventName = "opened" + EVENTNAME_CLICKED EventName = "clicked" + EVENTNAME_PROCESSED EventName = "processed" + EVENTNAME_DROPPED EventName = "dropped" + EVENTNAME_DELIVERED EventName = "delivered" + EVENTNAME_DEFERRED EventName = "deferred" + EVENTNAME_SPAM_REPORT EventName = "spam_report" + EVENTNAME_UNSUBSCRIBE EventName = "unsubscribe" + EVENTNAME_GROUP_UNSUBSCRIBE EventName = "group_unsubscribe" + EVENTNAME_GROUP_RESUBSCRIBE EventName = "group_resubscribe" +) diff --git a/rest/api/v3/email_activity/model_event_name1.go b/rest/api/v3/email_activity/model_event_name1.go new file mode 100644 index 00000000..28041369 --- /dev/null +++ b/rest/api/v3/email_activity/model_event_name1.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventName1 the model 'EventName1' +type EventName1 string + +// List of EventName1 +const ( + EVENTNAME1_BOUNCED EventName1 = "bounced" + EVENTNAME1_OPENED EventName1 = "opened" + EVENTNAME1_CLICKED EventName1 = "clicked" + EVENTNAME1_PROCESSED EventName1 = "processed" + EVENTNAME1_DROPPED EventName1 = "dropped" + EVENTNAME1_DELIVERED EventName1 = "delivered" + EVENTNAME1_DEFERRED EventName1 = "deferred" + EVENTNAME1_SPAM_REPORT EventName1 = "spam_report" + EVENTNAME1_UNSUBSCRIBE EventName1 = "unsubscribe" + EVENTNAME1_GROUP_UNSUBSCRIBE EventName1 = "group_unsubscribe" + EVENTNAME1_GROUP_RESUBSCRIBE EventName1 = "group_resubscribe" +) diff --git a/rest/api/v3/email_activity/model_get_message_404_response.go b/rest/api/v3/email_activity/model_get_message_404_response.go new file mode 100644 index 00000000..4ba14b45 --- /dev/null +++ b/rest/api/v3/email_activity/model_get_message_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetMessage404Response struct for GetMessage404Response +type GetMessage404Response struct { + Errors *[]GetMessage404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/email_activity/model_get_message_404_response_errors_inner.go b/rest/api/v3/email_activity/model_get_message_404_response_errors_inner.go new file mode 100644 index 00000000..c2a0aa50 --- /dev/null +++ b/rest/api/v3/email_activity/model_get_message_404_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetMessage404ResponseErrorsInner struct for GetMessage404ResponseErrorsInner +type GetMessage404ResponseErrorsInner struct { + Message *string `json:"message,omitempty"` + Field *string `json:"field,omitempty"` +} diff --git a/rest/api/v3/email_activity/model_list_message_200_response.go b/rest/api/v3/email_activity/model_list_message_200_response.go new file mode 100644 index 00000000..f66abfe1 --- /dev/null +++ b/rest/api/v3/email_activity/model_list_message_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMessage200Response struct for ListMessage200Response +type ListMessage200Response struct { + Messages *[]AbbvMessage `json:"messages,omitempty"` +} diff --git a/rest/api/v3/email_activity/model_list_message_400_response.go b/rest/api/v3/email_activity/model_list_message_400_response.go new file mode 100644 index 00000000..2ad9c3ff --- /dev/null +++ b/rest/api/v3/email_activity/model_list_message_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMessage400Response struct for ListMessage400Response +type ListMessage400Response struct { + Errors []ListMessage400ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/email_activity/model_list_message_400_response_errors_inner.go b/rest/api/v3/email_activity/model_list_message_400_response_errors_inner.go new file mode 100644 index 00000000..561b7001 --- /dev/null +++ b/rest/api/v3/email_activity/model_list_message_400_response_errors_inner.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMessage400ResponseErrorsInner struct for ListMessage400ResponseErrorsInner +type ListMessage400ResponseErrorsInner struct { + Message string `json:"message"` +} diff --git a/rest/api/v3/email_activity/model_list_message_429_response.go b/rest/api/v3/email_activity/model_list_message_429_response.go new file mode 100644 index 00000000..46d73b1f --- /dev/null +++ b/rest/api/v3/email_activity/model_list_message_429_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMessage429Response struct for ListMessage429Response +type ListMessage429Response struct { + Errors *[]ListMessage429ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/email_activity/model_list_message_429_response_errors_inner.go b/rest/api/v3/email_activity/model_list_message_429_response_errors_inner.go new file mode 100644 index 00000000..6d46e6cc --- /dev/null +++ b/rest/api/v3/email_activity/model_list_message_429_response_errors_inner.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMessage429ResponseErrorsInner struct for ListMessage429ResponseErrorsInner +type ListMessage429ResponseErrorsInner struct { + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/email_activity/model_message.go b/rest/api/v3/email_activity/model_message.go new file mode 100644 index 00000000..dad57509 --- /dev/null +++ b/rest/api/v3/email_activity/model_message.go @@ -0,0 +1,48 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Message struct for Message +type Message struct { + // The 'From' email address used to deliver the message. This address should be a verified sender in your Twilio SendGrid account. + FromEmail *string `json:"from_email,omitempty"` + // A unique ID assigned to the message. This ID can be used to retrieve activity data for the specific message. + MsgId *string `json:"msg_id,omitempty"` + // The email's subject line. + Subject *string `json:"subject,omitempty"` + // The intended recipient's email address. + ToEmail *string `json:"to_email,omitempty"` + // The message's status. + Status *Status3 `json:"status,omitempty"` + // The ID associated with a Twilio SendGrid email template used to format the message. + TemplateId string `json:"template_id"` + // The unsubscribe group associated with this email. + AsmGroupId int32 `json:"asm_group_id"` + // Teammate's username + Teammate string `json:"teammate"` + // The ID of the API Key used to authenticate the sending request for the message. + ApiKeyId string `json:"api_key_id"` + // List of events related to email message + Events []Event `json:"events"` + // This is the IP of the user who sent the message. + OriginatingIp string `json:"originating_ip"` + // Categories users associated to the message + Categories []string `json:"categories"` + // JSON hash of key-value pairs associated with the message. + UniqueArgs string `json:"unique_args"` + // IP used to send to the remote Mail Transfer Agent. + OutboundIp string `json:"outbound_ip"` + // Whether or not the outbound IP is dedicated vs shared + OutboundIpType OutboundIpType `json:"outbound_ip_type"` +} diff --git a/rest/api/v3/email_activity/model_outbound_ip_type.go b/rest/api/v3/email_activity/model_outbound_ip_type.go new file mode 100644 index 00000000..ae6cfae7 --- /dev/null +++ b/rest/api/v3/email_activity/model_outbound_ip_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// OutboundIpType the model 'OutboundIpType' +type OutboundIpType string + +// List of OutboundIpType +const ( + OUTBOUNDIPTYPE_DEDICATED OutboundIpType = "dedicated" + OUTBOUNDIPTYPE_SHARED OutboundIpType = "shared" +) diff --git a/rest/api/v3/email_activity/model_outbound_ip_type1.go b/rest/api/v3/email_activity/model_outbound_ip_type1.go new file mode 100644 index 00000000..ad734c10 --- /dev/null +++ b/rest/api/v3/email_activity/model_outbound_ip_type1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// OutboundIpType1 the model 'OutboundIpType1' +type OutboundIpType1 string + +// List of OutboundIpType1 +const ( + OUTBOUNDIPTYPE1_DEDICATED OutboundIpType1 = "dedicated" + OUTBOUNDIPTYPE1_SHARED OutboundIpType1 = "shared" +) diff --git a/rest/api/v3/email_activity/model_request_csv_202_response.go b/rest/api/v3/email_activity/model_request_csv_202_response.go new file mode 100644 index 00000000..567a4c3f --- /dev/null +++ b/rest/api/v3/email_activity/model_request_csv_202_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// RequestCsv202Response struct for RequestCsv202Response +type RequestCsv202Response struct { + Status *Status2 `json:"status,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/email_activity/model_status.go b/rest/api/v3/email_activity/model_status.go new file mode 100644 index 00000000..5e003d33 --- /dev/null +++ b/rest/api/v3/email_activity/model_status.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status the model 'Status' +type Status string + +// List of Status +const ( + STATUS_PROCESSED Status = "processed" + STATUS_DELIVERED Status = "delivered" + STATUS_NOT_DELIVERED Status = "not_delivered" +) diff --git a/rest/api/v3/email_activity/model_status1.go b/rest/api/v3/email_activity/model_status1.go new file mode 100644 index 00000000..84650532 --- /dev/null +++ b/rest/api/v3/email_activity/model_status1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status1 the model 'Status1' +type Status1 string + +// List of Status1 +const ( + STATUS1_PROCESSED Status1 = "processed" + STATUS1_NOT_DELIVERED Status1 = "not_delivered" + STATUS1_DELIVERED Status1 = "delivered" +) diff --git a/rest/api/v3/email_activity/model_status2.go b/rest/api/v3/email_activity/model_status2.go new file mode 100644 index 00000000..f54b4277 --- /dev/null +++ b/rest/api/v3/email_activity/model_status2.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status2 the model 'Status2' +type Status2 string + +// List of Status2 +const ( + STATUS2_PENDING Status2 = "pending" +) diff --git a/rest/api/v3/email_activity/model_status3.go b/rest/api/v3/email_activity/model_status3.go new file mode 100644 index 00000000..0bbf51d8 --- /dev/null +++ b/rest/api/v3/email_activity/model_status3.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Activity API +* The Twilio SendGrid Email Activity API allows you to query all of your stored messages, query individual messages, and download a CSV with data about the stored messages. Once retrieved, you can inspect the data associated with your messages to better understand your mail send. For example, you may retrieve all bounced messages or all messages with the same subject line and search for commonalities among them. You must [purchase additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity) to gain access to the Email Activity Feed API. See **Getting Started with the Email Activity Feed API** for help building queries and working with this API. You can also work with email activity in the **Activity** section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/email_activity). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status3 the model 'Status3' +type Status3 string + +// List of Status3 +const ( + STATUS3_PROCESSED Status3 = "processed" + STATUS3_DELIVERED Status3 = "delivered" + STATUS3_NOT_DELIVERED Status3 = "not_delivered" +) diff --git a/rest/api/v3/email_validation/README.md b/rest/api/v3/email_validation/README.md new file mode 100644 index 00000000..af6d3899 --- /dev/null +++ b/rest/api/v3/email_validation/README.md @@ -0,0 +1,94 @@ +# Go API client for + +The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. + +Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. + +You can use this API to: +- Indicate to users that the address they have entered into a form is invalid. +- Drop invalid email addresses from your database. +- Suppress invalid email addresses from your sending to decrease your bounce rate. + +See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. + +You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.492490+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*GetEmailJobForVerification* | [**GetEmailJobForVerification**](docs/GetEmailJobForVerification.md#getemailjobforverification) | **Get** /v3/validations/email/jobs/{JobId} | This request returns a single Bulk Email Validation Job. +*GetValidationsEmailJobs* | [**GetValidationsEmailJobs**](docs/GetValidationsEmailJobs.md#getvalidationsemailjobs) | **Get** /v3/validations/email/jobs | This request lists all of a user's Bulk Email Validation Jobs. +*ListEmailJobForVerification* | [**ListEmailJobForVerification**](docs/ListEmailJobForVerification.md#listemailjobforverification) | **Put** /v3/validations/email/jobs | Request a presigned URL and headers for Bulk Email Address Validation list upload. +*ValidateEmail* | [**ValidateEmail**](docs/ValidateEmail.md#validateemail) | **Post** /v3/validations/email | Validate an email + + +## Documentation For Models + + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [FileType](FileType.md) + - [GetValidationsEmailJobs200Response](GetValidationsEmailJobs200Response.md) + - [GetValidationsEmailJobs200ResponseResultInner](GetValidationsEmailJobs200ResponseResultInner.md) + - [GetValidationsEmailJobsJobId200Response](GetValidationsEmailJobsJobId200Response.md) + - [GetValidationsEmailJobsJobId200ResponseResult](GetValidationsEmailJobsJobId200ResponseResult.md) + - [GetValidationsEmailJobsJobId200ResponseResultErrorsInner](GetValidationsEmailJobsJobId200ResponseResultErrorsInner.md) + - [ListEmailJobForVerificationRequest](ListEmailJobForVerificationRequest.md) + - [PutValidationsEmailJobs200Response](PutValidationsEmailJobs200Response.md) + - [PutValidationsEmailJobs200ResponseUploadHeadersInner](PutValidationsEmailJobs200ResponseUploadHeadersInner.md) + - [Status](Status.md) + - [Status1](Status1.md) + - [ValidateEmail200Response](ValidateEmail200Response.md) + - [ValidateEmail200ResponseResult](ValidateEmail200ResponseResult.md) + - [ValidateEmail200ResponseResultChecks](ValidateEmail200ResponseResultChecks.md) + - [ValidateEmail200ResponseResultChecksAdditional](ValidateEmail200ResponseResultChecksAdditional.md) + - [ValidateEmail200ResponseResultChecksDomain](ValidateEmail200ResponseResultChecksDomain.md) + - [ValidateEmail200ResponseResultChecksLocalPart](ValidateEmail200ResponseResultChecksLocalPart.md) + - [ValidateEmailRequest](ValidateEmailRequest.md) + - [Verdict](Verdict.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/email_validation/api_get_email_job_for_verification.go b/rest/api/v3/email_validation/api_get_email_job_for_verification.go new file mode 100644 index 00000000..48c691dd --- /dev/null +++ b/rest/api/v3/email_validation/api_get_email_job_for_verification.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetEmailJobForVerificationParam struct { + // The ID of the Bulk Email Address Validation Job you wish to retrieve. + JobId *string `json:"job_id"` +} + +func (params *GetEmailJobForVerificationParam) SetJobId(JobId string) *GetEmailJobForVerificationParam { + params.JobId = &JobId + return params +} + +// **This endpoint returns a specific Bulk Email Validation Job. You can use this endpoint to check on the progress of a Job.** +func (c *ApiService) GetEmailJobForVerification(params *GetEmailJobForVerificationParam) (interface{}, error) { + path := "/v3/validations/email/jobs/{JobId}" + if params != nil && params.JobId != nil { + path = strings.Replace(path, "{"+"JobId"+"}", *params.JobId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetValidationsEmailJobsJobId200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_validation/api_get_validations_email_jobs.go b/rest/api/v3/email_validation/api_get_validations_email_jobs.go new file mode 100644 index 00000000..d0364ff8 --- /dev/null +++ b/rest/api/v3/email_validation/api_get_validations_email_jobs.go @@ -0,0 +1,65 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type GetValidationsEmailJobsParam struct { +} + +// **This endpoint returns a list of all of a user's Bulk Email Validation Jobs.** +func (c *ApiService) GetValidationsEmailJobs() (interface{}, error) { + path := "/v3/validations/email/jobs" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetValidationsEmailJobs200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_validation/api_list_email_job_for_verification.go b/rest/api/v3/email_validation/api_list_email_job_for_verification.go new file mode 100644 index 00000000..5b218b94 --- /dev/null +++ b/rest/api/v3/email_validation/api_list_email_job_for_verification.go @@ -0,0 +1,81 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListEmailJobForVerificationParam struct { + // + ListEmailJobForVerificationRequest *ListEmailJobForVerificationRequest `json:"ListEmailJobForVerificationRequest,omitempty"` +} + +func (params *ListEmailJobForVerificationParam) SetListEmailJobForVerificationRequest(ListEmailJobForVerificationRequest ListEmailJobForVerificationRequest) *ListEmailJobForVerificationParam { + params.ListEmailJobForVerificationRequest = &ListEmailJobForVerificationRequest + return params +} + +// **This endpoint returns a presigned URL and request headers. Use this information to upload a list of email addresses for verification.** Note that in a successful response the `content-type` header value matches the provided `file_type` parameter in the `PUT` request. Once you have an `upload_uri` and the `upload_headers`, you're ready to upload your email address list for verification. For the expected format of the email address list and a sample upload request, see the [Bulk Email Address Validation Overview page](https://www.twilio.com/docs/sendgrid/ui/managing-contacts/email-address-validation/bulk-email-address-validation-overview). +func (c *ApiService) ListEmailJobForVerification(params *ListEmailJobForVerificationParam) (interface{}, error) { + path := "/v3/validations/email/jobs" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.ListEmailJobForVerificationRequest != nil { + b, err := json.Marshal(*params.ListEmailJobForVerificationRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &PutValidationsEmailJobs200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_validation/api_service.go b/rest/api/v3/email_validation/api_service.go new file mode 100644 index 00000000..12f01b4a --- /dev/null +++ b/rest/api/v3/email_validation/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/email_validation/api_validate_email.go b/rest/api/v3/email_validation/api_validate_email.go new file mode 100644 index 00000000..2e1ab9b4 --- /dev/null +++ b/rest/api/v3/email_validation/api_validate_email.go @@ -0,0 +1,65 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ValidateEmailParam struct { + // + ValidateEmailRequest *ValidateEmailRequest `json:"ValidateEmailRequest,omitempty"` +} + +func (params *ValidateEmailParam) SetValidateEmailRequest(ValidateEmailRequest ValidateEmailRequest) *ValidateEmailParam { + params.ValidateEmailRequest = &ValidateEmailRequest + return params +} + +// **This endpoint allows you to validate an email address.** +func (c *ApiService) ValidateEmail(params *ValidateEmailParam) (interface{}, error) { + path := "/v3/validations/email" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.ValidateEmailRequest != nil { + b, err := json.Marshal(*params.ValidateEmailRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ValidateEmail200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/email_validation/docs/ErrorResponse.md b/rest/api/v3/email_validation/docs/ErrorResponse.md new file mode 100644 index 00000000..7e5e23ed --- /dev/null +++ b/rest/api/v3/email_validation/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | ID representing the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ErrorResponseErrorsInner.md b/rest/api/v3/email_validation/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..f2c33b2a --- /dev/null +++ b/rest/api/v3/email_validation/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The message representing the error from the API. | +**Field** | **string** | The field associated with the error. |[optional] +**Help** | **map[string]interface{}** | Helper text or docs for troubleshooting. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/FileType.md b/rest/api/v3/email_validation/docs/FileType.md new file mode 100644 index 00000000..0108ebdf --- /dev/null +++ b/rest/api/v3/email_validation/docs/FileType.md @@ -0,0 +1,13 @@ +# FileType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CSV** | string | (value: `"csv"`) +**ZIP** | string | (value: `"zip"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/GetEmailJobForVerification.md b/rest/api/v3/email_validation/docs/GetEmailJobForVerification.md new file mode 100644 index 00000000..0184c450 --- /dev/null +++ b/rest/api/v3/email_validation/docs/GetEmailJobForVerification.md @@ -0,0 +1,51 @@ +# GetEmailJobForVerification + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetEmailJobForVerification**](GetEmailJobForVerification.md#GetEmailJobForVerification) | **Get** /v3/validations/email/jobs/{JobId} | This request returns a single Bulk Email Validation Job. + + + +## GetEmailJobForVerification + +> GetValidationsEmailJobsJobId200Response GetEmailJobForVerification(ctx, JobId) + +This request returns a single Bulk Email Validation Job. + +**This endpoint returns a specific Bulk Email Validation Job. You can use this endpoint to check on the progress of a Job.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**JobId** | **string** | The ID of the Bulk Email Address Validation Job you wish to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetEmailJobForVerificationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**GetValidationsEmailJobsJobId200Response**](GetValidationsEmailJobsJobId200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_validation/docs/GetValidationsEmailJobs.md b/rest/api/v3/email_validation/docs/GetValidationsEmailJobs.md new file mode 100644 index 00000000..65bc01db --- /dev/null +++ b/rest/api/v3/email_validation/docs/GetValidationsEmailJobs.md @@ -0,0 +1,44 @@ +# GetValidationsEmailJobs + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetValidationsEmailJobs**](GetValidationsEmailJobs.md#GetValidationsEmailJobs) | **Get** /v3/validations/email/jobs | This request lists all of a user's Bulk Email Validation Jobs. + + + +## GetValidationsEmailJobs + +> GetValidationsEmailJobs200Response GetValidationsEmailJobs(ctx, ) + +This request lists all of a user's Bulk Email Validation Jobs. + +**This endpoint returns a list of all of a user's Bulk Email Validation Jobs.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a GetValidationsEmailJobsParams struct + + +### Return type + +[**GetValidationsEmailJobs200Response**](GetValidationsEmailJobs200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_validation/docs/GetValidationsEmailJobs200Response.md b/rest/api/v3/email_validation/docs/GetValidationsEmailJobs200Response.md new file mode 100644 index 00000000..6005e09e --- /dev/null +++ b/rest/api/v3/email_validation/docs/GetValidationsEmailJobs200Response.md @@ -0,0 +1,11 @@ +# GetValidationsEmailJobs200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]GetValidationsEmailJobs200ResponseResultInner**](GetValidationsEmailJobs200ResponseResultInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/GetValidationsEmailJobs200ResponseResultInner.md b/rest/api/v3/email_validation/docs/GetValidationsEmailJobs200ResponseResultInner.md new file mode 100644 index 00000000..9f39fef1 --- /dev/null +++ b/rest/api/v3/email_validation/docs/GetValidationsEmailJobs200ResponseResultInner.md @@ -0,0 +1,14 @@ +# GetValidationsEmailJobs200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The unique ID of the Bulk Email Address Validation Job. |[optional] +**Status** | [**Status**](Status.md) | The status of the Bulk Email Address Validation Job. |[optional] +**StartedAt** | **float32** | The ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the `upload_uri`. |[optional] +**FinishedAt** | **float32** | The ISO8601 timestamp when the Job was finished. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200Response.md b/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200Response.md new file mode 100644 index 00000000..62a5383d --- /dev/null +++ b/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200Response.md @@ -0,0 +1,11 @@ +# GetValidationsEmailJobsJobId200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**GetValidationsEmailJobsJobId200ResponseResult**](GetValidationsEmailJobsJobId200ResponseResult.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResult.md b/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResult.md new file mode 100644 index 00000000..d9c9395f --- /dev/null +++ b/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResult.md @@ -0,0 +1,18 @@ +# GetValidationsEmailJobsJobId200ResponseResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The unique ID of the Bulk Email Address Validation Job. |[optional] +**Status** | [**Status1**](Status1.md) | The status of the Bulk Email Address Validation Job. |[optional] +**Segments** | **float32** | The total number of segments in the Bulk Email Address Validation Job. There are 1,500 email addresses per segment. The value is `0` until the Job `status` is `Processing`. |[optional] +**SegmentsProcessed** | **float32** | The number of segments processed at the time of the request. 100 segments process in parallel at a time. |[optional] +**IsDownloadAvailable** | **bool** | Boolean indicating whether the results CSV file is available for download. |[optional] +**StartedAt** | **float32** | The ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the `upload_uri`. |[optional] +**FinishedAt** | **float32** | The ISO8601 timestamp when the Job was finished. |[optional] +**Errors** | [**[]GetValidationsEmailJobsJobId200ResponseResultErrorsInner**](GetValidationsEmailJobsJobId200ResponseResultErrorsInner.md) | Array containing error messages related to the Bulk Email Address Validation Job. Array is empty if no errors ocurred. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResultErrorsInner.md b/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResultErrorsInner.md new file mode 100644 index 00000000..0d5492ae --- /dev/null +++ b/rest/api/v3/email_validation/docs/GetValidationsEmailJobsJobId200ResponseResultErrorsInner.md @@ -0,0 +1,11 @@ +# GetValidationsEmailJobsJobId200ResponseResultErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | Description of the error encountered during execution of the Bulk Email Address Validation Job. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ListEmailJobForVerification.md b/rest/api/v3/email_validation/docs/ListEmailJobForVerification.md new file mode 100644 index 00000000..6cd0053d --- /dev/null +++ b/rest/api/v3/email_validation/docs/ListEmailJobForVerification.md @@ -0,0 +1,48 @@ +# ListEmailJobForVerification + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListEmailJobForVerification**](ListEmailJobForVerification.md#ListEmailJobForVerification) | **Put** /v3/validations/email/jobs | Request a presigned URL and headers for Bulk Email Address Validation list upload. + + + +## ListEmailJobForVerification + +> PutValidationsEmailJobs200Response ListEmailJobForVerification(ctx, optional) + +Request a presigned URL and headers for Bulk Email Address Validation list upload. + +**This endpoint returns a presigned URL and request headers. Use this information to upload a list of email addresses for verification.** Note that in a successful response the `content-type` header value matches the provided `file_type` parameter in the `PUT` request. Once you have an `upload_uri` and the `upload_headers`, you're ready to upload your email address list for verification. For the expected format of the email address list and a sample upload request, see the [Bulk Email Address Validation Overview page](https://www.twilio.com/docs/sendgrid/ui/managing-contacts/email-address-validation/bulk-email-address-validation-overview). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListEmailJobForVerificationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**ListEmailJobForVerificationRequest** | [**ListEmailJobForVerificationRequest**](ListEmailJobForVerificationRequest.md) | + +### Return type + +[**PutValidationsEmailJobs200Response**](PutValidationsEmailJobs200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_validation/docs/ListEmailJobForVerificationRequest.md b/rest/api/v3/email_validation/docs/ListEmailJobForVerificationRequest.md new file mode 100644 index 00000000..a3d4fb06 --- /dev/null +++ b/rest/api/v3/email_validation/docs/ListEmailJobForVerificationRequest.md @@ -0,0 +1,11 @@ +# ListEmailJobForVerificationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FileType** | [**FileType**](FileType.md) | The format of the file you wish to upload. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/PutValidationsEmailJobs200Response.md b/rest/api/v3/email_validation/docs/PutValidationsEmailJobs200Response.md new file mode 100644 index 00000000..7caf2bcc --- /dev/null +++ b/rest/api/v3/email_validation/docs/PutValidationsEmailJobs200Response.md @@ -0,0 +1,13 @@ +# PutValidationsEmailJobs200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JobId** | **string** | The unique ID of the Bulk Email Address Validation Job. |[optional] +**UploadUri** | **string** | The URI to use for the request to upload your list of email addresses. |[optional] +**UploadHeaders** | [**[]PutValidationsEmailJobs200ResponseUploadHeadersInner**](PutValidationsEmailJobs200ResponseUploadHeadersInner.md) | Array containing headers and header values. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/PutValidationsEmailJobs200ResponseUploadHeadersInner.md b/rest/api/v3/email_validation/docs/PutValidationsEmailJobs200ResponseUploadHeadersInner.md new file mode 100644 index 00000000..96781e62 --- /dev/null +++ b/rest/api/v3/email_validation/docs/PutValidationsEmailJobs200ResponseUploadHeadersInner.md @@ -0,0 +1,12 @@ +# PutValidationsEmailJobs200ResponseUploadHeadersInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Header** | **string** | The name of the header that must be included in the upload request. |[optional] +**Value** | **string** | The value of the header that must be included in the upload request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/Status.md b/rest/api/v3/email_validation/docs/Status.md new file mode 100644 index 00000000..3915e79c --- /dev/null +++ b/rest/api/v3/email_validation/docs/Status.md @@ -0,0 +1,17 @@ +# Status + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**INITIATED** | string | (value: `"Initiated"`) +**QUEUED** | string | (value: `"Queued"`) +**READY** | string | (value: `"Ready"`) +**PROCESSING** | string | (value: `"Processing"`) +**DONE** | string | (value: `"Done"`) +**ERROR** | string | (value: `"Error"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/Status1.md b/rest/api/v3/email_validation/docs/Status1.md new file mode 100644 index 00000000..a6d983e9 --- /dev/null +++ b/rest/api/v3/email_validation/docs/Status1.md @@ -0,0 +1,17 @@ +# Status1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**INITIATED** | string | (value: `"Initiated"`) +**QUEUED** | string | (value: `"Queued"`) +**READY** | string | (value: `"Ready"`) +**PROCESSING** | string | (value: `"Processing"`) +**DONE** | string | (value: `"Done"`) +**ERROR** | string | (value: `"Error"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ValidateEmail.md b/rest/api/v3/email_validation/docs/ValidateEmail.md new file mode 100644 index 00000000..6d217df2 --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmail.md @@ -0,0 +1,48 @@ +# ValidateEmail + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ValidateEmail**](ValidateEmail.md#ValidateEmail) | **Post** /v3/validations/email | Validate an email + + + +## ValidateEmail + +> ValidateEmail200Response ValidateEmail(ctx, optional) + +Validate an email + +**This endpoint allows you to validate an email address.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ValidateEmailParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**ValidateEmailRequest** | [**ValidateEmailRequest**](ValidateEmailRequest.md) | + +### Return type + +[**ValidateEmail200Response**](ValidateEmail200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/email_validation/docs/ValidateEmail200Response.md b/rest/api/v3/email_validation/docs/ValidateEmail200Response.md new file mode 100644 index 00000000..1fe2612e --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmail200Response.md @@ -0,0 +1,11 @@ +# ValidateEmail200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**ValidateEmail200ResponseResult**](ValidateEmail200ResponseResult.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResult.md b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResult.md new file mode 100644 index 00000000..1de44347 --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResult.md @@ -0,0 +1,19 @@ +# ValidateEmail200ResponseResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email being validated | +**Verdict** | [**Verdict**](Verdict.md) | A generic classification of whether or not the email address is valid. | +**Score** | **float32** | A numeric representation of the email validity. | +**Local** | **string** | The local part of the email address. | +**Host** | **string** | The domain of the email address. | +**Suggestion** | **string** | A suggested correction in the event of domain name typos (e.g., gmial.com) |[optional] +**Checks** | [**ValidateEmail200ResponseResultChecks**](ValidateEmail200ResponseResultChecks.md) | | +**Source** | **string** | The source of the validation, as per the API request. |[optional] +**IpAddress** | **string** | The IP address associated with this email. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecks.md b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecks.md new file mode 100644 index 00000000..d664bcf0 --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecks.md @@ -0,0 +1,13 @@ +# ValidateEmail200ResponseResultChecks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Domain** | [**ValidateEmail200ResponseResultChecksDomain**](ValidateEmail200ResponseResultChecksDomain.md) | | +**LocalPart** | [**ValidateEmail200ResponseResultChecksLocalPart**](ValidateEmail200ResponseResultChecksLocalPart.md) | | +**Additional** | [**ValidateEmail200ResponseResultChecksAdditional**](ValidateEmail200ResponseResultChecksAdditional.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksAdditional.md b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksAdditional.md new file mode 100644 index 00000000..ff503099 --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksAdditional.md @@ -0,0 +1,12 @@ +# ValidateEmail200ResponseResultChecksAdditional + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasKnownBounces** | **bool** | Whether email sent to this address from your account has bounced. | +**HasSuspectedBounces** | **bool** | Whether our model predicts that the email address might bounce. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksDomain.md b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksDomain.md new file mode 100644 index 00000000..3d2d75b3 --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksDomain.md @@ -0,0 +1,13 @@ +# ValidateEmail200ResponseResultChecksDomain + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasValidAddressSyntax** | **bool** | Whether the email address syntax is valid. | +**HasMxOrARecord** | **bool** | Whether the email has appropriate DNS records to deliver a message. | +**IsSuspectedDisposableAddress** | **bool** | Whether the domain appears to be from a disposable email address service. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksLocalPart.md b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksLocalPart.md new file mode 100644 index 00000000..7219d6de --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmail200ResponseResultChecksLocalPart.md @@ -0,0 +1,11 @@ +# ValidateEmail200ResponseResultChecksLocalPart + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsSuspectedRoleAddress** | **bool** | Whether the local part of email appears to be a role or group (e.g., hr, admin) | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/ValidateEmailRequest.md b/rest/api/v3/email_validation/docs/ValidateEmailRequest.md new file mode 100644 index 00000000..404db498 --- /dev/null +++ b/rest/api/v3/email_validation/docs/ValidateEmailRequest.md @@ -0,0 +1,12 @@ +# ValidateEmailRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address that you want to validate. | +**Source** | **string** | A one-word classifier for where this validation originated. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/docs/Verdict.md b/rest/api/v3/email_validation/docs/Verdict.md new file mode 100644 index 00000000..5f6dae14 --- /dev/null +++ b/rest/api/v3/email_validation/docs/Verdict.md @@ -0,0 +1,14 @@ +# Verdict + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**VALID** | string | (value: `"Valid"`) +**RISKY** | string | (value: `"Risky"`) +**INVALID** | string | (value: `"Invalid"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/email_validation/model_error_response.go b/rest/api/v3/email_validation/model_error_response.go new file mode 100644 index 00000000..0471f1b6 --- /dev/null +++ b/rest/api/v3/email_validation/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // ID representing the error. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_error_response_errors_inner.go b/rest/api/v3/email_validation/model_error_response_errors_inner.go new file mode 100644 index 00000000..363c1a49 --- /dev/null +++ b/rest/api/v3/email_validation/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // The message representing the error from the API. + Message string `json:"message"` + // The field associated with the error. + Field *string `json:"field,omitempty"` + // Helper text or docs for troubleshooting. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_file_type.go b/rest/api/v3/email_validation/model_file_type.go new file mode 100644 index 00000000..9326cdd5 --- /dev/null +++ b/rest/api/v3/email_validation/model_file_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// FileType the model 'FileType' +type FileType string + +// List of FileType +const ( + FILETYPE_CSV FileType = "csv" + FILETYPE_ZIP FileType = "zip" +) diff --git a/rest/api/v3/email_validation/model_get_validations_email_jobs200_response.go b/rest/api/v3/email_validation/model_get_validations_email_jobs200_response.go new file mode 100644 index 00000000..435a4a34 --- /dev/null +++ b/rest/api/v3/email_validation/model_get_validations_email_jobs200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetValidationsEmailJobs200Response struct for GetValidationsEmailJobs200Response +type GetValidationsEmailJobs200Response struct { + // + Result *[]GetValidationsEmailJobs200ResponseResultInner `json:"result,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_get_validations_email_jobs200_response_result_inner.go b/rest/api/v3/email_validation/model_get_validations_email_jobs200_response_result_inner.go new file mode 100644 index 00000000..8e1859d9 --- /dev/null +++ b/rest/api/v3/email_validation/model_get_validations_email_jobs200_response_result_inner.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetValidationsEmailJobs200ResponseResultInner struct for GetValidationsEmailJobs200ResponseResultInner +type GetValidationsEmailJobs200ResponseResultInner struct { + // The unique ID of the Bulk Email Address Validation Job. + Id *string `json:"id,omitempty"` + // The status of the Bulk Email Address Validation Job. + Status *Status `json:"status,omitempty"` + // The ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the `upload_uri`. + StartedAt *float32 `json:"started_at,omitempty"` + // The ISO8601 timestamp when the Job was finished. + FinishedAt *float32 `json:"finished_at,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response.go b/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response.go new file mode 100644 index 00000000..d7625423 --- /dev/null +++ b/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetValidationsEmailJobsJobId200Response struct for GetValidationsEmailJobsJobId200Response +type GetValidationsEmailJobsJobId200Response struct { + Result *GetValidationsEmailJobsJobId200ResponseResult `json:"result,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result.go b/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result.go new file mode 100644 index 00000000..0f6d9761 --- /dev/null +++ b/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetValidationsEmailJobsJobId200ResponseResult +type GetValidationsEmailJobsJobId200ResponseResult struct { + // The unique ID of the Bulk Email Address Validation Job. + Id *string `json:"id,omitempty"` + // The status of the Bulk Email Address Validation Job. + Status *Status1 `json:"status,omitempty"` + // The total number of segments in the Bulk Email Address Validation Job. There are 1,500 email addresses per segment. The value is `0` until the Job `status` is `Processing`. + Segments *float32 `json:"segments,omitempty"` + // The number of segments processed at the time of the request. 100 segments process in parallel at a time. + SegmentsProcessed *float32 `json:"segments_processed,omitempty"` + // Boolean indicating whether the results CSV file is available for download. + IsDownloadAvailable *bool `json:"is_download_available,omitempty"` + // The ISO8601 timestamp when the Job was created. This is the time at which the upload request was sent to the `upload_uri`. + StartedAt *float32 `json:"started_at,omitempty"` + // The ISO8601 timestamp when the Job was finished. + FinishedAt *float32 `json:"finished_at,omitempty"` + // Array containing error messages related to the Bulk Email Address Validation Job. Array is empty if no errors ocurred. + Errors *[]GetValidationsEmailJobsJobId200ResponseResultErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result_errors_inner.go b/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result_errors_inner.go new file mode 100644 index 00000000..db8ee837 --- /dev/null +++ b/rest/api/v3/email_validation/model_get_validations_email_jobs_job_id200_response_result_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetValidationsEmailJobsJobId200ResponseResultErrorsInner struct for GetValidationsEmailJobsJobId200ResponseResultErrorsInner +type GetValidationsEmailJobsJobId200ResponseResultErrorsInner struct { + // Description of the error encountered during execution of the Bulk Email Address Validation Job. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_list_email_job_for_verification_request.go b/rest/api/v3/email_validation/model_list_email_job_for_verification_request.go new file mode 100644 index 00000000..6ec08c9a --- /dev/null +++ b/rest/api/v3/email_validation/model_list_email_job_for_verification_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListEmailJobForVerificationRequest struct for ListEmailJobForVerificationRequest +type ListEmailJobForVerificationRequest struct { + // The format of the file you wish to upload. + FileType FileType `json:"file_type"` +} diff --git a/rest/api/v3/email_validation/model_put_validations_email_jobs200_response.go b/rest/api/v3/email_validation/model_put_validations_email_jobs200_response.go new file mode 100644 index 00000000..3c8bfba2 --- /dev/null +++ b/rest/api/v3/email_validation/model_put_validations_email_jobs200_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PutValidationsEmailJobs200Response struct for PutValidationsEmailJobs200Response +type PutValidationsEmailJobs200Response struct { + // The unique ID of the Bulk Email Address Validation Job. + JobId *string `json:"job_id,omitempty"` + // The URI to use for the request to upload your list of email addresses. + UploadUri *string `json:"upload_uri,omitempty"` + // Array containing headers and header values. + UploadHeaders *[]PutValidationsEmailJobs200ResponseUploadHeadersInner `json:"upload_headers,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_put_validations_email_jobs200_response_upload_headers_inner.go b/rest/api/v3/email_validation/model_put_validations_email_jobs200_response_upload_headers_inner.go new file mode 100644 index 00000000..5763532e --- /dev/null +++ b/rest/api/v3/email_validation/model_put_validations_email_jobs200_response_upload_headers_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PutValidationsEmailJobs200ResponseUploadHeadersInner struct for PutValidationsEmailJobs200ResponseUploadHeadersInner +type PutValidationsEmailJobs200ResponseUploadHeadersInner struct { + // The name of the header that must be included in the upload request. + Header *string `json:"header,omitempty"` + // The value of the header that must be included in the upload request. + Value *string `json:"value,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_status.go b/rest/api/v3/email_validation/model_status.go new file mode 100644 index 00000000..c92c4771 --- /dev/null +++ b/rest/api/v3/email_validation/model_status.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status the model 'Status' +type Status string + +// List of Status +const ( + STATUS_INITIATED Status = "Initiated" + STATUS_QUEUED Status = "Queued" + STATUS_READY Status = "Ready" + STATUS_PROCESSING Status = "Processing" + STATUS_DONE Status = "Done" + STATUS_ERROR Status = "Error" +) diff --git a/rest/api/v3/email_validation/model_status1.go b/rest/api/v3/email_validation/model_status1.go new file mode 100644 index 00000000..eb3f76b1 --- /dev/null +++ b/rest/api/v3/email_validation/model_status1.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status1 the model 'Status1' +type Status1 string + +// List of Status1 +const ( + STATUS1_INITIATED Status1 = "Initiated" + STATUS1_QUEUED Status1 = "Queued" + STATUS1_READY Status1 = "Ready" + STATUS1_PROCESSING Status1 = "Processing" + STATUS1_DONE Status1 = "Done" + STATUS1_ERROR Status1 = "Error" +) diff --git a/rest/api/v3/email_validation/model_validate_email_200_response.go b/rest/api/v3/email_validation/model_validate_email_200_response.go new file mode 100644 index 00000000..bd91dd02 --- /dev/null +++ b/rest/api/v3/email_validation/model_validate_email_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateEmail200Response struct for ValidateEmail200Response +type ValidateEmail200Response struct { + Result ValidateEmail200ResponseResult `json:"result"` +} diff --git a/rest/api/v3/email_validation/model_validate_email_200_response_result.go b/rest/api/v3/email_validation/model_validate_email_200_response_result.go new file mode 100644 index 00000000..44356b58 --- /dev/null +++ b/rest/api/v3/email_validation/model_validate_email_200_response_result.go @@ -0,0 +1,35 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateEmail200ResponseResult struct for ValidateEmail200ResponseResult +type ValidateEmail200ResponseResult struct { + // The email being validated + Email string `json:"email"` + // A generic classification of whether or not the email address is valid. + Verdict Verdict `json:"verdict"` + // A numeric representation of the email validity. + Score float32 `json:"score"` + // The local part of the email address. + Local string `json:"local"` + // The domain of the email address. + Host string `json:"host"` + // A suggested correction in the event of domain name typos (e.g., gmial.com) + Suggestion *string `json:"suggestion,omitempty"` + Checks ValidateEmail200ResponseResultChecks `json:"checks"` + // The source of the validation, as per the API request. + Source *string `json:"source,omitempty"` + // The IP address associated with this email. + IpAddress string `json:"ip_address"` +} diff --git a/rest/api/v3/email_validation/model_validate_email_200_response_result_checks.go b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks.go new file mode 100644 index 00000000..5238ab2c --- /dev/null +++ b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateEmail200ResponseResultChecks Granular checks for email address validity. +type ValidateEmail200ResponseResultChecks struct { + Domain ValidateEmail200ResponseResultChecksDomain `json:"domain"` + LocalPart ValidateEmail200ResponseResultChecksLocalPart `json:"local_part"` + Additional ValidateEmail200ResponseResultChecksAdditional `json:"additional"` +} diff --git a/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_additional.go b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_additional.go new file mode 100644 index 00000000..a805b2f6 --- /dev/null +++ b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_additional.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateEmail200ResponseResultChecksAdditional Additional checks on the email address. +type ValidateEmail200ResponseResultChecksAdditional struct { + // Whether email sent to this address from your account has bounced. + HasKnownBounces bool `json:"has_known_bounces"` + // Whether our model predicts that the email address might bounce. + HasSuspectedBounces bool `json:"has_suspected_bounces"` +} diff --git a/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_domain.go b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_domain.go new file mode 100644 index 00000000..2effd822 --- /dev/null +++ b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_domain.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateEmail200ResponseResultChecksDomain Checks on the domain portion of the email address. +type ValidateEmail200ResponseResultChecksDomain struct { + // Whether the email address syntax is valid. + HasValidAddressSyntax bool `json:"has_valid_address_syntax"` + // Whether the email has appropriate DNS records to deliver a message. + HasMxOrARecord bool `json:"has_mx_or_a_record"` + // Whether the domain appears to be from a disposable email address service. + IsSuspectedDisposableAddress bool `json:"is_suspected_disposable_address"` +} diff --git a/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_local_part.go b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_local_part.go new file mode 100644 index 00000000..2290db2a --- /dev/null +++ b/rest/api/v3/email_validation/model_validate_email_200_response_result_checks_local_part.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateEmail200ResponseResultChecksLocalPart Checks on the local part of the email address. +type ValidateEmail200ResponseResultChecksLocalPart struct { + // Whether the local part of email appears to be a role or group (e.g., hr, admin) + IsSuspectedRoleAddress bool `json:"is_suspected_role_address"` +} diff --git a/rest/api/v3/email_validation/model_validate_email_request.go b/rest/api/v3/email_validation/model_validate_email_request.go new file mode 100644 index 00000000..f8f03693 --- /dev/null +++ b/rest/api/v3/email_validation/model_validate_email_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateEmailRequest struct for ValidateEmailRequest +type ValidateEmailRequest struct { + // The email address that you want to validate. + Email string `json:"email"` + // A one-word classifier for where this validation originated. + Source *string `json:"source,omitempty"` +} diff --git a/rest/api/v3/email_validation/model_verdict.go b/rest/api/v3/email_validation/model_verdict.go new file mode 100644 index 00000000..d7fdf767 --- /dev/null +++ b/rest/api/v3/email_validation/model_verdict.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Email Address Validation API +* The Twilio SendGrid Email Address Validation API provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case. Email Address Validation is available to [Email API Pro and Premier level accounts](https://sendgrid.com/pricing) only. Prior to upgrading your account to Pro or Premier, you will not see the option to create an Email Validation API key. An Email Validation API key is separate from and in addition to your other keys, including Full Access API keys. You can use this API to: - Indicate to users that the address they have entered into a form is invalid. - Drop invalid email addresses from your database. - Suppress invalid email addresses from your sending to decrease your bounce rate. See [**Email Address Validation**](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation) for more information. You can also view your Email Validation results and metrics in the Validation section of the [Twilio SendGrid application user interface](https://docs.sendgrid.com/ui/managing-contacts/email-address-validation). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Verdict the model 'Verdict' +type Verdict string + +// List of Verdict +const ( + VERDICT_VALID Verdict = "Valid" + VERDICT_RISKY Verdict = "Risky" + VERDICT_INVALID Verdict = "Invalid" +) diff --git a/rest/api/v3/enforced_tls/README.md b/rest/api/v3/enforced_tls/README.md new file mode 100644 index 00000000..5ce51635 --- /dev/null +++ b/rest/api/v3/enforced_tls/README.md @@ -0,0 +1,68 @@ +# Go API client for + +The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. + +Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. + +You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.490412+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ListEnforcedTlsSetting* | [**ListEnforcedTlsSetting**](docs/ListEnforcedTlsSetting.md#listenforcedtlssetting) | **Get** /v3/user/settings/enforced_tls | Retrieve current Enforced TLS settings. +*UpdateEnforcedTlsSetting* | [**UpdateEnforcedTlsSetting**](docs/UpdateEnforcedTlsSetting.md#updateenforcedtlssetting) | **Patch** /v3/user/settings/enforced_tls | Update Enforced TLS settings + + +## Documentation For Models + + - [EnforcedTlsRequestResponse](EnforcedTlsRequestResponse.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [Version](Version.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/enforced_tls/api_list_enforced_tls_setting.go b/rest/api/v3/enforced_tls/api_list_enforced_tls_setting.go new file mode 100644 index 00000000..7c633a58 --- /dev/null +++ b/rest/api/v3/enforced_tls/api_list_enforced_tls_setting.go @@ -0,0 +1,83 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Enforced TLS API +* The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListEnforcedTlsSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListEnforcedTlsSettingParam) SetOnbehalfof(Onbehalfof string) *ListEnforcedTlsSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current Enforced TLS settings.** The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description. +func (c *ApiService) ListEnforcedTlsSetting(params *ListEnforcedTlsSettingParam) (interface{}, error) { + path := "/v3/user/settings/enforced_tls" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &EnforcedTlsRequestResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/enforced_tls/api_service.go b/rest/api/v3/enforced_tls/api_service.go new file mode 100644 index 00000000..b52f212f --- /dev/null +++ b/rest/api/v3/enforced_tls/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Enforced TLS API +* The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/enforced_tls/api_update_enforced_tls_setting.go b/rest/api/v3/enforced_tls/api_update_enforced_tls_setting.go new file mode 100644 index 00000000..1b43aa93 --- /dev/null +++ b/rest/api/v3/enforced_tls/api_update_enforced_tls_setting.go @@ -0,0 +1,98 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Enforced TLS API +* The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateEnforcedTlsSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + EnforcedTlsRequestResponse *EnforcedTlsRequestResponse `json:"EnforcedTlsRequestResponse,omitempty"` +} + +func (params *UpdateEnforcedTlsSettingParam) SetOnbehalfof(Onbehalfof string) *UpdateEnforcedTlsSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateEnforcedTlsSettingParam) SetEnforcedTlsRequestResponse(EnforcedTlsRequestResponse EnforcedTlsRequestResponse) *UpdateEnforcedTlsSettingParam { + params.EnforcedTlsRequestResponse = &EnforcedTlsRequestResponse + return params +} + +// **This endpoint allows you to update your Enforced TLS settings.** To require TLS from recipients, set `require_tls` to `true`. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description. +func (c *ApiService) UpdateEnforcedTlsSetting(params *UpdateEnforcedTlsSettingParam) (interface{}, error) { + path := "/v3/user/settings/enforced_tls" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.EnforcedTlsRequestResponse != nil { + b, err := json.Marshal(*params.EnforcedTlsRequestResponse) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &EnforcedTlsRequestResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/enforced_tls/docs/EnforcedTlsRequestResponse.md b/rest/api/v3/enforced_tls/docs/EnforcedTlsRequestResponse.md new file mode 100644 index 00000000..afa34268 --- /dev/null +++ b/rest/api/v3/enforced_tls/docs/EnforcedTlsRequestResponse.md @@ -0,0 +1,13 @@ +# EnforcedTlsRequestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequireTls** | **bool** | Indicates if you want to require your recipients to support TLS. |[optional] +**RequireValidCert** | **bool** | Indicates if you want to require your recipients to have a valid certificate. |[optional] +**Version** | [**Version**](Version.md) | The minimum required TLS certificate version. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/enforced_tls/docs/ErrorResponse.md b/rest/api/v3/enforced_tls/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/enforced_tls/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/enforced_tls/docs/ErrorResponseErrorsInner.md b/rest/api/v3/enforced_tls/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/enforced_tls/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/enforced_tls/docs/ListEnforcedTlsSetting.md b/rest/api/v3/enforced_tls/docs/ListEnforcedTlsSetting.md new file mode 100644 index 00000000..43d636d3 --- /dev/null +++ b/rest/api/v3/enforced_tls/docs/ListEnforcedTlsSetting.md @@ -0,0 +1,48 @@ +# ListEnforcedTlsSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListEnforcedTlsSetting**](ListEnforcedTlsSetting.md#ListEnforcedTlsSetting) | **Get** /v3/user/settings/enforced_tls | Retrieve current Enforced TLS settings. + + + +## ListEnforcedTlsSetting + +> EnforcedTlsRequestResponse ListEnforcedTlsSetting(ctx, optional) + +Retrieve current Enforced TLS settings. + +**This endpoint allows you to retrieve your current Enforced TLS settings.** The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListEnforcedTlsSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**EnforcedTlsRequestResponse**](EnforcedTlsRequestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/enforced_tls/docs/UpdateEnforcedTlsSetting.md b/rest/api/v3/enforced_tls/docs/UpdateEnforcedTlsSetting.md new file mode 100644 index 00000000..958bc070 --- /dev/null +++ b/rest/api/v3/enforced_tls/docs/UpdateEnforcedTlsSetting.md @@ -0,0 +1,49 @@ +# UpdateEnforcedTlsSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateEnforcedTlsSetting**](UpdateEnforcedTlsSetting.md#UpdateEnforcedTlsSetting) | **Patch** /v3/user/settings/enforced_tls | Update Enforced TLS settings + + + +## UpdateEnforcedTlsSetting + +> EnforcedTlsRequestResponse UpdateEnforcedTlsSetting(ctx, optional) + +Update Enforced TLS settings + +**This endpoint allows you to update your Enforced TLS settings.** To require TLS from recipients, set `require_tls` to `true`. If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, Twilio SendGrid will drop the message and send a block event with “TLS required but not supported” as the description. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateEnforcedTlsSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**EnforcedTlsRequestResponse** | [**EnforcedTlsRequestResponse**](EnforcedTlsRequestResponse.md) | + +### Return type + +[**EnforcedTlsRequestResponse**](EnforcedTlsRequestResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/enforced_tls/docs/Version.md b/rest/api/v3/enforced_tls/docs/Version.md new file mode 100644 index 00000000..0dff80c4 --- /dev/null +++ b/rest/api/v3/enforced_tls/docs/Version.md @@ -0,0 +1,14 @@ +# Version + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**_1_DOT_1** | float32 | (value: `1.1`) +**_1_DOT_2** | float32 | (value: `1.2`) +**_1_DOT_3** | float32 | (value: `1.3`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/enforced_tls/model_enforced_tls_request_response.go b/rest/api/v3/enforced_tls/model_enforced_tls_request_response.go new file mode 100644 index 00000000..7788c006 --- /dev/null +++ b/rest/api/v3/enforced_tls/model_enforced_tls_request_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Enforced TLS API +* The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EnforcedTlsRequestResponse struct for EnforcedTlsRequestResponse +type EnforcedTlsRequestResponse struct { + // Indicates if you want to require your recipients to support TLS. + RequireTls *bool `json:"require_tls,omitempty"` + // Indicates if you want to require your recipients to have a valid certificate. + RequireValidCert *bool `json:"require_valid_cert,omitempty"` + // The minimum required TLS certificate version. + Version *Version `json:"version,omitempty"` +} diff --git a/rest/api/v3/enforced_tls/model_error_response.go b/rest/api/v3/enforced_tls/model_error_response.go new file mode 100644 index 00000000..5c54a419 --- /dev/null +++ b/rest/api/v3/enforced_tls/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Enforced TLS API +* The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/enforced_tls/model_error_response_errors_inner.go b/rest/api/v3/enforced_tls/model_error_response_errors_inner.go new file mode 100644 index 00000000..f31a0e09 --- /dev/null +++ b/rest/api/v3/enforced_tls/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Enforced TLS API +* The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/enforced_tls/model_version.go b/rest/api/v3/enforced_tls/model_version.go new file mode 100644 index 00000000..731e1719 --- /dev/null +++ b/rest/api/v3/enforced_tls/model_version.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Enforced TLS API +* The Twilio SendGrid Enforced TLS API allows you to specify whether or not the recipient of your mail send is required to support TLS or have a valid certificate. Twilio SendGrid sends all emails with [Opportunistic TLS](https://sendgrid.com/blog/myth-opportunistic-tls-email-privacy/) by default, meaning email is sent with TLS, and if the recipient's inbox provider does not accept the TLS encryption, we then send the message unencrypted. You can optionally choose to enforce TLS encryption, meaning that if the recipient's inbox provider does not accept the TLS encryption, Twilio SendGrid drops the message and sends a block event with the message, “TLS required but not supported” as the description. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Version the model 'Version' +type Version float32 + +// List of Version +const ( + VERSION__1_DOT_1 Version = 1.1 + VERSION__1_DOT_2 Version = 1.2 + VERSION__1_DOT_3 Version = 1.3 +) diff --git a/rest/api/v3/integrations/README.md b/rest/api/v3/integrations/README.md new file mode 100644 index 00000000..a7aafef9 --- /dev/null +++ b/rest/api/v3/integrations/README.md @@ -0,0 +1,94 @@ +# Go API client for + +Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.495372+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AddIntegration* | [**AddIntegration**](docs/AddIntegration.md#addintegration) | **Post** /v3/marketing/integrations | CreateIntegration +*DeleteIntegration* | [**DeleteIntegration**](docs/DeleteIntegration.md#deleteintegration) | **Delete** /v3/marketing/integrations | DeleteBulkIntegration +*FindIntegrationById* | [**FindIntegrationById**](docs/FindIntegrationById.md#findintegrationbyid) | **Get** /v3/marketing/integrations/{Id} | GetIntegration +*GetIntegrationsByUser* | [**GetIntegrationsByUser**](docs/GetIntegrationsByUser.md#getintegrationsbyuser) | **Get** /v3/marketing/integrations | ListIntegration +*UpdateIntegration* | [**UpdateIntegration**](docs/UpdateIntegration.md#updateintegration) | **Patch** /v3/marketing/integrations/{Id} | UpdateIntegration + + +## Documentation For Models + + - [AddIntegration400Response](AddIntegration400Response.md) + - [DeleteIntegration400Response](DeleteIntegration400Response.md) + - [DeleteIntegration404Response](DeleteIntegration404Response.md) + - [Destination](Destination.md) + - [Destination1](Destination1.md) + - [Destination2](Destination2.md) + - [Destination3](Destination3.md) + - [DestinationRegion](DestinationRegion.md) + - [DestinationRegion1](DestinationRegion1.md) + - [DestinationRegion2](DestinationRegion2.md) + - [Forbidden](Forbidden.md) + - [GetIntegrationsByUser200Response](GetIntegrationsByUser200Response.md) + - [GetIntegrationsByUser403Response](GetIntegrationsByUser403Response.md) + - [GetIntegrationsByUser500Response](GetIntegrationsByUser500Response.md) + - [Id](Id.md) + - [Integration](Integration.md) + - [IntegrationFilters](IntegrationFilters.md) + - [IntegrationInput](IntegrationInput.md) + - [IntegrationInputFilters](IntegrationInputFilters.md) + - [IntegrationInputProperties](IntegrationInputProperties.md) + - [IntegrationNotFound](IntegrationNotFound.md) + - [IntegrationPatch](IntegrationPatch.md) + - [IntegrationPatchFilters](IntegrationPatchFilters.md) + - [IntegrationPatchProperties](IntegrationPatchProperties.md) + - [IntegrationProperties](IntegrationProperties.md) + - [InternalError](InternalError.md) + - [InvalidDeleteRequest](InvalidDeleteRequest.md) + - [InvalidRequest](InvalidRequest.md) + - [Items](Items.md) + - [Items1](Items1.md) + - [Items2](Items2.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/integrations/api_add_integration.go b/rest/api/v3/integrations/api_add_integration.go new file mode 100644 index 00000000..618c0140 --- /dev/null +++ b/rest/api/v3/integrations/api_add_integration.go @@ -0,0 +1,89 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type AddIntegrationParam struct { + // + IntegrationInput *IntegrationInput `json:"IntegrationInput"` +} + +func (params *AddIntegrationParam) SetIntegrationInput(IntegrationInput IntegrationInput) *AddIntegrationParam { + params.IntegrationInput = &IntegrationInput + return params +} + +// This endpoint creates an Integration for email event forwarding. Each Integration has a maximum number of allowed Integration instances per user. For example, users can create up to 10 Segment Integrations. +func (c *ApiService) AddIntegration(params *AddIntegrationParam) (interface{}, error) { + path := "/v3/marketing/integrations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.IntegrationInput != nil { + b, err := json.Marshal(*params.IntegrationInput) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &Integration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &AddIntegration400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &GetIntegrationsByUser403Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &GetIntegrationsByUser500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/integrations/api_delete_integration.go b/rest/api/v3/integrations/api_delete_integration.go new file mode 100644 index 00000000..8d429939 --- /dev/null +++ b/rest/api/v3/integrations/api_delete_integration.go @@ -0,0 +1,93 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type DeleteIntegrationParam struct { + // Comma-delimited Integration IDs for the Integrations to delete. + Ids *[]Id `json:"ids"` +} + +func (params *DeleteIntegrationParam) SetIds(Ids []Id) *DeleteIntegrationParam { + params.Ids = &Ids + return params +} + +// This endpoint deletes Integrations. +func (c *ApiService) DeleteIntegration(params *DeleteIntegrationParam) (interface{}, error) { + path := "/v3/marketing/integrations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ids != nil { + for _, item := range *params.Ids { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("ids", string(v)) + + } + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &DeleteIntegration400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &GetIntegrationsByUser403Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteIntegration404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &GetIntegrationsByUser500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/integrations/api_find_integration_by_id.go b/rest/api/v3/integrations/api_find_integration_by_id.go new file mode 100644 index 00000000..0d44a223 --- /dev/null +++ b/rest/api/v3/integrations/api_find_integration_by_id.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type FindIntegrationByIdParam struct { + // The ID of the Integration you would like to retrieve. + Id *string `json:"id"` +} + +func (params *FindIntegrationByIdParam) SetId(Id string) *FindIntegrationByIdParam { + params.Id = &Id + return params +} + +// This endpoint returns the data for a specific Integration. +func (c *ApiService) FindIntegrationById(params *FindIntegrationByIdParam) (interface{}, error) { + path := "/v3/marketing/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Integration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &GetIntegrationsByUser403Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteIntegration404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &GetIntegrationsByUser500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/integrations/api_get_integrations_by_user.go b/rest/api/v3/integrations/api_get_integrations_by_user.go new file mode 100644 index 00000000..ce3f797f --- /dev/null +++ b/rest/api/v3/integrations/api_get_integrations_by_user.go @@ -0,0 +1,65 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type GetIntegrationsByUserParam struct { +} + +// This endpoint returns all the Integrations for the user making this call. +func (c *ApiService) GetIntegrationsByUser() (interface{}, error) { + path := "/v3/marketing/integrations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetIntegrationsByUser200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &GetIntegrationsByUser403Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &GetIntegrationsByUser500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/integrations/api_service.go b/rest/api/v3/integrations/api_service.go new file mode 100644 index 00000000..6a43a8ff --- /dev/null +++ b/rest/api/v3/integrations/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/integrations/api_update_integration.go b/rest/api/v3/integrations/api_update_integration.go new file mode 100644 index 00000000..26c0fb32 --- /dev/null +++ b/rest/api/v3/integrations/api_update_integration.go @@ -0,0 +1,108 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateIntegrationParam struct { + // The ID of the Integration you would like to update. + Id *string `json:"id"` + // + IntegrationPatch *IntegrationPatch `json:"IntegrationPatch"` +} + +func (params *UpdateIntegrationParam) SetId(Id string) *UpdateIntegrationParam { + params.Id = &Id + return params +} +func (params *UpdateIntegrationParam) SetIntegrationPatch(IntegrationPatch IntegrationPatch) *UpdateIntegrationParam { + params.IntegrationPatch = &IntegrationPatch + return params +} + +// This endpoint updates an existing Integration. +func (c *ApiService) UpdateIntegration(params *UpdateIntegrationParam) (interface{}, error) { + path := "/v3/marketing/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.IntegrationPatch != nil { + b, err := json.Marshal(*params.IntegrationPatch) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Integration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &AddIntegration400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &GetIntegrationsByUser403Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteIntegration404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &GetIntegrationsByUser500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/integrations/docs/AddIntegration.md b/rest/api/v3/integrations/docs/AddIntegration.md new file mode 100644 index 00000000..ffe11319 --- /dev/null +++ b/rest/api/v3/integrations/docs/AddIntegration.md @@ -0,0 +1,47 @@ +# AddIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddIntegration**](AddIntegration.md#AddIntegration) | **Post** /v3/marketing/integrations | CreateIntegration + + + +## AddIntegration + +> Integration AddIntegration(ctx, IntegrationInput) + +CreateIntegration + +This endpoint creates an Integration for email event forwarding. Each Integration has a maximum number of allowed Integration instances per user. For example, users can create up to 10 Segment Integrations. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a AddIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**Integration**](Integration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/integrations/docs/AddIntegration400Response.md b/rest/api/v3/integrations/docs/AddIntegration400Response.md new file mode 100644 index 00000000..c08231ce --- /dev/null +++ b/rest/api/v3/integrations/docs/AddIntegration400Response.md @@ -0,0 +1,11 @@ +# AddIntegration400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]InvalidRequest**](InvalidRequest.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/DeleteIntegration.md b/rest/api/v3/integrations/docs/DeleteIntegration.md new file mode 100644 index 00000000..730e43f0 --- /dev/null +++ b/rest/api/v3/integrations/docs/DeleteIntegration.md @@ -0,0 +1,47 @@ +# DeleteIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteIntegration**](DeleteIntegration.md#DeleteIntegration) | **Delete** /v3/marketing/integrations | DeleteBulkIntegration + + + +## DeleteIntegration + +> DeleteIntegration(ctx, Ids) + +DeleteBulkIntegration + +This endpoint deletes Integrations. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/integrations/docs/DeleteIntegration400Response.md b/rest/api/v3/integrations/docs/DeleteIntegration400Response.md new file mode 100644 index 00000000..52a6707f --- /dev/null +++ b/rest/api/v3/integrations/docs/DeleteIntegration400Response.md @@ -0,0 +1,11 @@ +# DeleteIntegration400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]InvalidDeleteRequest**](InvalidDeleteRequest.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/DeleteIntegration404Response.md b/rest/api/v3/integrations/docs/DeleteIntegration404Response.md new file mode 100644 index 00000000..ab33a208 --- /dev/null +++ b/rest/api/v3/integrations/docs/DeleteIntegration404Response.md @@ -0,0 +1,11 @@ +# DeleteIntegration404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]IntegrationNotFound**](IntegrationNotFound.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Destination.md b/rest/api/v3/integrations/docs/Destination.md new file mode 100644 index 00000000..e0a69331 --- /dev/null +++ b/rest/api/v3/integrations/docs/Destination.md @@ -0,0 +1,12 @@ +# Destination + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SEGMENT** | string | (value: `"Segment"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Destination1.md b/rest/api/v3/integrations/docs/Destination1.md new file mode 100644 index 00000000..eeff58b5 --- /dev/null +++ b/rest/api/v3/integrations/docs/Destination1.md @@ -0,0 +1,12 @@ +# Destination1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SEGMENT** | string | (value: `"Segment"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Destination2.md b/rest/api/v3/integrations/docs/Destination2.md new file mode 100644 index 00000000..6c18c7f8 --- /dev/null +++ b/rest/api/v3/integrations/docs/Destination2.md @@ -0,0 +1,12 @@ +# Destination2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SEGMENT** | string | (value: `"Segment"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Destination3.md b/rest/api/v3/integrations/docs/Destination3.md new file mode 100644 index 00000000..bfbae361 --- /dev/null +++ b/rest/api/v3/integrations/docs/Destination3.md @@ -0,0 +1,12 @@ +# Destination3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SEGMENT** | string | (value: `"Segment"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/DestinationRegion.md b/rest/api/v3/integrations/docs/DestinationRegion.md new file mode 100644 index 00000000..1a56b3c2 --- /dev/null +++ b/rest/api/v3/integrations/docs/DestinationRegion.md @@ -0,0 +1,13 @@ +# DestinationRegion + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"EU"`) +**US** | string | (value: `"US"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/DestinationRegion1.md b/rest/api/v3/integrations/docs/DestinationRegion1.md new file mode 100644 index 00000000..42ac76a4 --- /dev/null +++ b/rest/api/v3/integrations/docs/DestinationRegion1.md @@ -0,0 +1,13 @@ +# DestinationRegion1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"EU"`) +**US** | string | (value: `"US"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/DestinationRegion2.md b/rest/api/v3/integrations/docs/DestinationRegion2.md new file mode 100644 index 00000000..b79835bb --- /dev/null +++ b/rest/api/v3/integrations/docs/DestinationRegion2.md @@ -0,0 +1,13 @@ +# DestinationRegion2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"EU"`) +**US** | string | (value: `"US"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/FindIntegrationById.md b/rest/api/v3/integrations/docs/FindIntegrationById.md new file mode 100644 index 00000000..3f19621a --- /dev/null +++ b/rest/api/v3/integrations/docs/FindIntegrationById.md @@ -0,0 +1,51 @@ +# FindIntegrationById + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindIntegrationById**](FindIntegrationById.md#FindIntegrationById) | **Get** /v3/marketing/integrations/{Id} | GetIntegration + + + +## FindIntegrationById + +> Integration FindIntegrationById(ctx, Id) + +GetIntegration + +This endpoint returns the data for a specific Integration. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Integration you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a FindIntegrationByIdParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**Integration**](Integration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/integrations/docs/Forbidden.md b/rest/api/v3/integrations/docs/Forbidden.md new file mode 100644 index 00000000..1852697e --- /dev/null +++ b/rest/api/v3/integrations/docs/Forbidden.md @@ -0,0 +1,11 @@ +# Forbidden + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The error message tells you the cause of failure. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/GetIntegrationsByUser.md b/rest/api/v3/integrations/docs/GetIntegrationsByUser.md new file mode 100644 index 00000000..c692ef46 --- /dev/null +++ b/rest/api/v3/integrations/docs/GetIntegrationsByUser.md @@ -0,0 +1,44 @@ +# GetIntegrationsByUser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetIntegrationsByUser**](GetIntegrationsByUser.md#GetIntegrationsByUser) | **Get** /v3/marketing/integrations | ListIntegration + + + +## GetIntegrationsByUser + +> GetIntegrationsByUser200Response GetIntegrationsByUser(ctx, ) + +ListIntegration + +This endpoint returns all the Integrations for the user making this call. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a GetIntegrationsByUserParams struct + + +### Return type + +[**GetIntegrationsByUser200Response**](GetIntegrationsByUser200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/integrations/docs/GetIntegrationsByUser200Response.md b/rest/api/v3/integrations/docs/GetIntegrationsByUser200Response.md new file mode 100644 index 00000000..511b87d8 --- /dev/null +++ b/rest/api/v3/integrations/docs/GetIntegrationsByUser200Response.md @@ -0,0 +1,11 @@ +# GetIntegrationsByUser200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]Integration**](Integration.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/GetIntegrationsByUser403Response.md b/rest/api/v3/integrations/docs/GetIntegrationsByUser403Response.md new file mode 100644 index 00000000..59d7a833 --- /dev/null +++ b/rest/api/v3/integrations/docs/GetIntegrationsByUser403Response.md @@ -0,0 +1,11 @@ +# GetIntegrationsByUser403Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]Forbidden**](Forbidden.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/GetIntegrationsByUser500Response.md b/rest/api/v3/integrations/docs/GetIntegrationsByUser500Response.md new file mode 100644 index 00000000..6d5d7f88 --- /dev/null +++ b/rest/api/v3/integrations/docs/GetIntegrationsByUser500Response.md @@ -0,0 +1,11 @@ +# GetIntegrationsByUser500Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]InternalError**](InternalError.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Id.md b/rest/api/v3/integrations/docs/Id.md new file mode 100644 index 00000000..67dc46d0 --- /dev/null +++ b/rest/api/v3/integrations/docs/Id.md @@ -0,0 +1,11 @@ +# Id + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegrationId** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Integration.md b/rest/api/v3/integrations/docs/Integration.md new file mode 100644 index 00000000..a3645110 --- /dev/null +++ b/rest/api/v3/integrations/docs/Integration.md @@ -0,0 +1,16 @@ +# Integration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegrationId** | **string** | The unique ID of an Integration. |[optional] +**UserId** | **string** | Your Twilio SendGrid account ID. |[optional] +**Filters** | [**IntegrationFilters**](IntegrationFilters.md) | |[optional] +**Properties** | [**IntegrationProperties**](IntegrationProperties.md) | |[optional] +**Label** | **string** | The nickname for the Integration. |[optional] [default to "Untitled Integration"] +**Destination** | [**Destination3**](Destination3.md) | The third-party application you would like to forward your events to. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationFilters.md b/rest/api/v3/integrations/docs/IntegrationFilters.md new file mode 100644 index 00000000..17812e6e --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationFilters.md @@ -0,0 +1,11 @@ +# IntegrationFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EmailEvents** | [**[]Items2**](Items2.md) | The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationInput.md b/rest/api/v3/integrations/docs/IntegrationInput.md new file mode 100644 index 00000000..0d6fa829 --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationInput.md @@ -0,0 +1,14 @@ +# IntegrationInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Destination** | [**Destination2**](Destination2.md) | The third-party application you would like to forward your events to. | +**Filters** | [**IntegrationInputFilters**](IntegrationInputFilters.md) | | +**Properties** | [**IntegrationInputProperties**](IntegrationInputProperties.md) | | +**Label** | **string** | The nickname for the Integration. |[optional] [default to "Untitled Integration"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationInputFilters.md b/rest/api/v3/integrations/docs/IntegrationInputFilters.md new file mode 100644 index 00000000..dc1ebf0f --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationInputFilters.md @@ -0,0 +1,11 @@ +# IntegrationInputFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EmailEvents** | [**[]Items1**](Items1.md) | The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationInputProperties.md b/rest/api/v3/integrations/docs/IntegrationInputProperties.md new file mode 100644 index 00000000..5e56f5d6 --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationInputProperties.md @@ -0,0 +1,12 @@ +# IntegrationInputProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**WriteKey** | **string** | The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters. | +**DestinationRegion** | [**DestinationRegion1**](DestinationRegion1.md) | The workspace region where the Segment Source write key lives. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationNotFound.md b/rest/api/v3/integrations/docs/IntegrationNotFound.md new file mode 100644 index 00000000..dc5cbacf --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationNotFound.md @@ -0,0 +1,11 @@ +# IntegrationNotFound + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The error message tells you the cause of failure. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationPatch.md b/rest/api/v3/integrations/docs/IntegrationPatch.md new file mode 100644 index 00000000..bf974d8c --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationPatch.md @@ -0,0 +1,14 @@ +# IntegrationPatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Destination** | [**Destination1**](Destination1.md) | The third-party application you would like to forward your email events to. |[optional] +**Filters** | [**IntegrationPatchFilters**](IntegrationPatchFilters.md) | |[optional] +**Properties** | [**IntegrationPatchProperties**](IntegrationPatchProperties.md) | |[optional] +**Label** | **string** | The nickname for the Integration. |[optional] [default to "Untitled Integration"] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationPatchFilters.md b/rest/api/v3/integrations/docs/IntegrationPatchFilters.md new file mode 100644 index 00000000..4feb447e --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationPatchFilters.md @@ -0,0 +1,11 @@ +# IntegrationPatchFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EmailEvents** | [**[]Items**](Items.md) | The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationPatchProperties.md b/rest/api/v3/integrations/docs/IntegrationPatchProperties.md new file mode 100644 index 00000000..2ef4f33f --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationPatchProperties.md @@ -0,0 +1,12 @@ +# IntegrationPatchProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**WriteKey** | **string** | The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters. |[optional] +**DestinationRegion** | [**DestinationRegion**](DestinationRegion.md) | The workspace region where the Segment Source write key lives. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/IntegrationProperties.md b/rest/api/v3/integrations/docs/IntegrationProperties.md new file mode 100644 index 00000000..9ddebe9b --- /dev/null +++ b/rest/api/v3/integrations/docs/IntegrationProperties.md @@ -0,0 +1,12 @@ +# IntegrationProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**WriteKey** | **string** | The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters. |[optional] +**DestinationRegion** | [**DestinationRegion2**](DestinationRegion2.md) | The workspace region where the Segment Source write key lives. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/InternalError.md b/rest/api/v3/integrations/docs/InternalError.md new file mode 100644 index 00000000..46bca29a --- /dev/null +++ b/rest/api/v3/integrations/docs/InternalError.md @@ -0,0 +1,11 @@ +# InternalError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The error message tells you the cause of failure. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/InvalidDeleteRequest.md b/rest/api/v3/integrations/docs/InvalidDeleteRequest.md new file mode 100644 index 00000000..0a26bf26 --- /dev/null +++ b/rest/api/v3/integrations/docs/InvalidDeleteRequest.md @@ -0,0 +1,12 @@ +# InvalidDeleteRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The error message tells you the cause of failure. |[optional] +**Parameter** | **string** | The parameter shows more information about where the error is. The number in the brackets is the invalid ID indexed. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/InvalidRequest.md b/rest/api/v3/integrations/docs/InvalidRequest.md new file mode 100644 index 00000000..2058d058 --- /dev/null +++ b/rest/api/v3/integrations/docs/InvalidRequest.md @@ -0,0 +1,12 @@ +# InvalidRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The error message tells you the cause of validation failure(s), separated by commas if there are multiple failures. |[optional] +**Field** | **string** | The field shows more information on where the error is when available. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Items.md b/rest/api/v3/integrations/docs/Items.md new file mode 100644 index 00000000..31a64e99 --- /dev/null +++ b/rest/api/v3/integrations/docs/Items.md @@ -0,0 +1,23 @@ +# Items + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DROP** | string | (value: `"drop"`) +**PROCESSED** | string | (value: `"processed"`) +**DEFERRED** | string | (value: `"deferred"`) +**GROUP_UNSUBSCRIBE** | string | (value: `"group_unsubscribe"`) +**BOUNCE** | string | (value: `"bounce"`) +**DELIVERED** | string | (value: `"delivered"`) +**CLICK** | string | (value: `"click"`) +**UNSUBSCRIBE** | string | (value: `"unsubscribe"`) +**OPEN** | string | (value: `"open"`) +**GROUP_RESUBSCRIBE** | string | (value: `"group_resubscribe"`) +**SPAMREPORT** | string | (value: `"spamreport"`) +**MACHINE_OPENED** | string | (value: `"machine_opened"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Items1.md b/rest/api/v3/integrations/docs/Items1.md new file mode 100644 index 00000000..70d35e3a --- /dev/null +++ b/rest/api/v3/integrations/docs/Items1.md @@ -0,0 +1,23 @@ +# Items1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DROP** | string | (value: `"drop"`) +**PROCESSED** | string | (value: `"processed"`) +**DEFERRED** | string | (value: `"deferred"`) +**GROUP_UNSUBSCRIBE** | string | (value: `"group_unsubscribe"`) +**BOUNCE** | string | (value: `"bounce"`) +**DELIVERED** | string | (value: `"delivered"`) +**CLICK** | string | (value: `"click"`) +**UNSUBSCRIBE** | string | (value: `"unsubscribe"`) +**OPEN** | string | (value: `"open"`) +**GROUP_RESUBSCRIBE** | string | (value: `"group_resubscribe"`) +**SPAMREPORT** | string | (value: `"spamreport"`) +**MACHINE_OPENED** | string | (value: `"machine_opened"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/Items2.md b/rest/api/v3/integrations/docs/Items2.md new file mode 100644 index 00000000..07701e8f --- /dev/null +++ b/rest/api/v3/integrations/docs/Items2.md @@ -0,0 +1,23 @@ +# Items2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DROP** | string | (value: `"drop"`) +**PROCESSED** | string | (value: `"processed"`) +**DEFERRED** | string | (value: `"deferred"`) +**GROUP_UNSUBSCRIBE** | string | (value: `"group_unsubscribe"`) +**BOUNCE** | string | (value: `"bounce"`) +**DELIVERED** | string | (value: `"delivered"`) +**CLICK** | string | (value: `"click"`) +**UNSUBSCRIBE** | string | (value: `"unsubscribe"`) +**OPEN** | string | (value: `"open"`) +**GROUP_RESUBSCRIBE** | string | (value: `"group_resubscribe"`) +**SPAMREPORT** | string | (value: `"spamreport"`) +**MACHINE_OPENED** | string | (value: `"machine_opened"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/integrations/docs/UpdateIntegration.md b/rest/api/v3/integrations/docs/UpdateIntegration.md new file mode 100644 index 00000000..f3fb79c2 --- /dev/null +++ b/rest/api/v3/integrations/docs/UpdateIntegration.md @@ -0,0 +1,51 @@ +# UpdateIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateIntegration**](UpdateIntegration.md#UpdateIntegration) | **Patch** /v3/marketing/integrations/{Id} | UpdateIntegration + + + +## UpdateIntegration + +> Integration UpdateIntegration(ctx, IdIntegrationPatch) + +UpdateIntegration + +This endpoint updates an existing Integration. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Integration you would like to update. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**Integration**](Integration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/integrations/model_add_integration_400_response.go b/rest/api/v3/integrations/model_add_integration_400_response.go new file mode 100644 index 00000000..ad8e53b3 --- /dev/null +++ b/rest/api/v3/integrations/model_add_integration_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIntegration400Response struct for AddIntegration400Response +type AddIntegration400Response struct { + Errors *[]InvalidRequest `json:"errors,omitempty"` +} diff --git a/rest/api/v3/integrations/model_delete_integration_400_response.go b/rest/api/v3/integrations/model_delete_integration_400_response.go new file mode 100644 index 00000000..81d15a69 --- /dev/null +++ b/rest/api/v3/integrations/model_delete_integration_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteIntegration400Response struct for DeleteIntegration400Response +type DeleteIntegration400Response struct { + Errors *[]InvalidDeleteRequest `json:"errors,omitempty"` +} diff --git a/rest/api/v3/integrations/model_delete_integration_404_response.go b/rest/api/v3/integrations/model_delete_integration_404_response.go new file mode 100644 index 00000000..990eeba8 --- /dev/null +++ b/rest/api/v3/integrations/model_delete_integration_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteIntegration404Response struct for DeleteIntegration404Response +type DeleteIntegration404Response struct { + Errors *[]IntegrationNotFound `json:"errors,omitempty"` +} diff --git a/rest/api/v3/integrations/model_destination.go b/rest/api/v3/integrations/model_destination.go new file mode 100644 index 00000000..133a8563 --- /dev/null +++ b/rest/api/v3/integrations/model_destination.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Destination The third-party application you would like to forward your email events to. +type Destination string + +// List of Destination +const ( + DESTINATION_SEGMENT Destination = "Segment" +) diff --git a/rest/api/v3/integrations/model_destination1.go b/rest/api/v3/integrations/model_destination1.go new file mode 100644 index 00000000..4350d666 --- /dev/null +++ b/rest/api/v3/integrations/model_destination1.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Destination1 the model 'Destination1' +type Destination1 string + +// List of Destination1 +const ( + DESTINATION1_SEGMENT Destination1 = "Segment" +) diff --git a/rest/api/v3/integrations/model_destination2.go b/rest/api/v3/integrations/model_destination2.go new file mode 100644 index 00000000..f888e2ef --- /dev/null +++ b/rest/api/v3/integrations/model_destination2.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Destination2 the model 'Destination2' +type Destination2 string + +// List of Destination2 +const ( + DESTINATION2_SEGMENT Destination2 = "Segment" +) diff --git a/rest/api/v3/integrations/model_destination3.go b/rest/api/v3/integrations/model_destination3.go new file mode 100644 index 00000000..7ef311db --- /dev/null +++ b/rest/api/v3/integrations/model_destination3.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Destination3 the model 'Destination3' +type Destination3 string + +// List of Destination3 +const ( + DESTINATION3_SEGMENT Destination3 = "Segment" +) diff --git a/rest/api/v3/integrations/model_destination_region.go b/rest/api/v3/integrations/model_destination_region.go new file mode 100644 index 00000000..b972f4cc --- /dev/null +++ b/rest/api/v3/integrations/model_destination_region.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DestinationRegion the model 'DestinationRegion' +type DestinationRegion string + +// List of DestinationRegion +const ( + DESTINATIONREGION_EU DestinationRegion = "EU" + DESTINATIONREGION_US DestinationRegion = "US" +) diff --git a/rest/api/v3/integrations/model_destination_region1.go b/rest/api/v3/integrations/model_destination_region1.go new file mode 100644 index 00000000..fe5b5c33 --- /dev/null +++ b/rest/api/v3/integrations/model_destination_region1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DestinationRegion1 the model 'DestinationRegion1' +type DestinationRegion1 string + +// List of DestinationRegion1 +const ( + DESTINATIONREGION1_EU DestinationRegion1 = "EU" + DESTINATIONREGION1_US DestinationRegion1 = "US" +) diff --git a/rest/api/v3/integrations/model_destination_region2.go b/rest/api/v3/integrations/model_destination_region2.go new file mode 100644 index 00000000..85079c07 --- /dev/null +++ b/rest/api/v3/integrations/model_destination_region2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DestinationRegion2 the model 'DestinationRegion2' +type DestinationRegion2 string + +// List of DestinationRegion2 +const ( + DESTINATIONREGION2_EU DestinationRegion2 = "EU" + DESTINATIONREGION2_US DestinationRegion2 = "US" +) diff --git a/rest/api/v3/integrations/model_forbidden.go b/rest/api/v3/integrations/model_forbidden.go new file mode 100644 index 00000000..9e941266 --- /dev/null +++ b/rest/api/v3/integrations/model_forbidden.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Forbidden struct for Forbidden +type Forbidden struct { + // The error message tells you the cause of failure. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/integrations/model_get_integrations_by_user_200_response.go b/rest/api/v3/integrations/model_get_integrations_by_user_200_response.go new file mode 100644 index 00000000..f7421247 --- /dev/null +++ b/rest/api/v3/integrations/model_get_integrations_by_user_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIntegrationsByUser200Response struct for GetIntegrationsByUser200Response +type GetIntegrationsByUser200Response struct { + Result *[]Integration `json:"result,omitempty"` +} diff --git a/rest/api/v3/integrations/model_get_integrations_by_user_403_response.go b/rest/api/v3/integrations/model_get_integrations_by_user_403_response.go new file mode 100644 index 00000000..c0b4cf0a --- /dev/null +++ b/rest/api/v3/integrations/model_get_integrations_by_user_403_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIntegrationsByUser403Response struct for GetIntegrationsByUser403Response +type GetIntegrationsByUser403Response struct { + Errors *[]Forbidden `json:"errors,omitempty"` +} diff --git a/rest/api/v3/integrations/model_get_integrations_by_user_500_response.go b/rest/api/v3/integrations/model_get_integrations_by_user_500_response.go new file mode 100644 index 00000000..c315cb2b --- /dev/null +++ b/rest/api/v3/integrations/model_get_integrations_by_user_500_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIntegrationsByUser500Response struct for GetIntegrationsByUser500Response +type GetIntegrationsByUser500Response struct { + Errors *[]InternalError `json:"errors,omitempty"` +} diff --git a/rest/api/v3/integrations/model_id.go b/rest/api/v3/integrations/model_id.go new file mode 100644 index 00000000..e5ddf078 --- /dev/null +++ b/rest/api/v3/integrations/model_id.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Id The unique ID of an Integration. +type Id struct { + IntegrationId *string `json:"integration_id,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration.go b/rest/api/v3/integrations/model_integration.go new file mode 100644 index 00000000..82d04c57 --- /dev/null +++ b/rest/api/v3/integrations/model_integration.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Integration struct for Integration +type Integration struct { + // The unique ID of an Integration. + IntegrationId *string `json:"integration_id,omitempty"` + // Your Twilio SendGrid account ID. + UserId *string `json:"user_id,omitempty"` + Filters *IntegrationFilters `json:"filters,omitempty"` + Properties *IntegrationProperties `json:"properties,omitempty"` + // The nickname for the Integration. + Label *string `json:"label,omitempty"` + // The third-party application you would like to forward your events to. + Destination *Destination3 `json:"destination,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration_filters.go b/rest/api/v3/integrations/model_integration_filters.go new file mode 100644 index 00000000..fbf2911c --- /dev/null +++ b/rest/api/v3/integrations/model_integration_filters.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationFilters The configurable filters for SendGrid to destination email event forwarding. +type IntegrationFilters struct { + // The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination. + EmailEvents *[]Items2 `json:"email_events,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration_input.go b/rest/api/v3/integrations/model_integration_input.go new file mode 100644 index 00000000..032d394b --- /dev/null +++ b/rest/api/v3/integrations/model_integration_input.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationInput struct for IntegrationInput +type IntegrationInput struct { + // The third-party application you would like to forward your events to. + Destination Destination2 `json:"destination"` + Filters IntegrationInputFilters `json:"filters"` + Properties IntegrationInputProperties `json:"properties"` + // The nickname for the Integration. + Label *string `json:"label,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration_input_filters.go b/rest/api/v3/integrations/model_integration_input_filters.go new file mode 100644 index 00000000..15f01bb0 --- /dev/null +++ b/rest/api/v3/integrations/model_integration_input_filters.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationInputFilters The configurable filters for SendGrid to destination email event forwarding. +type IntegrationInputFilters struct { + // The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination. + EmailEvents []Items1 `json:"email_events"` +} diff --git a/rest/api/v3/integrations/model_integration_input_properties.go b/rest/api/v3/integrations/model_integration_input_properties.go new file mode 100644 index 00000000..b4c3a181 --- /dev/null +++ b/rest/api/v3/integrations/model_integration_input_properties.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationInputProperties The properties of an Integration required to send events to a specific third-party application. +type IntegrationInputProperties struct { + // The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters. + WriteKey string `json:"write_key"` + // The workspace region where the Segment Source write key lives. + DestinationRegion DestinationRegion1 `json:"destination_region"` +} diff --git a/rest/api/v3/integrations/model_integration_not_found.go b/rest/api/v3/integrations/model_integration_not_found.go new file mode 100644 index 00000000..ae903136 --- /dev/null +++ b/rest/api/v3/integrations/model_integration_not_found.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationNotFound struct for IntegrationNotFound +type IntegrationNotFound struct { + // The error message tells you the cause of failure. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration_patch.go b/rest/api/v3/integrations/model_integration_patch.go new file mode 100644 index 00000000..0f43f1a8 --- /dev/null +++ b/rest/api/v3/integrations/model_integration_patch.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationPatch struct for IntegrationPatch +type IntegrationPatch struct { + // The third-party application you would like to forward your email events to. + Destination *Destination1 `json:"destination,omitempty"` + Filters *IntegrationPatchFilters `json:"filters,omitempty"` + Properties *IntegrationPatchProperties `json:"properties,omitempty"` + // The nickname for the Integration. + Label *string `json:"label,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration_patch_filters.go b/rest/api/v3/integrations/model_integration_patch_filters.go new file mode 100644 index 00000000..0ded71fd --- /dev/null +++ b/rest/api/v3/integrations/model_integration_patch_filters.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationPatchFilters The configurable filters for SendGrid to destination email event forwarding. +type IntegrationPatchFilters struct { + // The possible SendGrid email event types for event forwarding. Specify all the email event types that you would like to forward to the Integration's destination. + EmailEvents *[]Items `json:"email_events,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration_patch_properties.go b/rest/api/v3/integrations/model_integration_patch_properties.go new file mode 100644 index 00000000..f8fd78c1 --- /dev/null +++ b/rest/api/v3/integrations/model_integration_patch_properties.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationPatchProperties The properties of an Integration required to send events to a specific third-party application. +type IntegrationPatchProperties struct { + // The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters. + WriteKey *string `json:"write_key,omitempty"` + // The workspace region where the Segment Source write key lives. + DestinationRegion *DestinationRegion `json:"destination_region,omitempty"` +} diff --git a/rest/api/v3/integrations/model_integration_properties.go b/rest/api/v3/integrations/model_integration_properties.go new file mode 100644 index 00000000..822fec09 --- /dev/null +++ b/rest/api/v3/integrations/model_integration_properties.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IntegrationProperties The properties of an Integration required to send events to a specific third-party application. +type IntegrationProperties struct { + // The write key provided by the Segment Source you'd like to have events forwarded to. Must be between 6 and 51 characters. + WriteKey *string `json:"write_key,omitempty"` + // The workspace region where the Segment Source write key lives. + DestinationRegion *DestinationRegion2 `json:"destination_region,omitempty"` +} diff --git a/rest/api/v3/integrations/model_internal_error.go b/rest/api/v3/integrations/model_internal_error.go new file mode 100644 index 00000000..34b072b8 --- /dev/null +++ b/rest/api/v3/integrations/model_internal_error.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// InternalError struct for InternalError +type InternalError struct { + // The error message tells you the cause of failure. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/integrations/model_invalid_delete_request.go b/rest/api/v3/integrations/model_invalid_delete_request.go new file mode 100644 index 00000000..6adbbc72 --- /dev/null +++ b/rest/api/v3/integrations/model_invalid_delete_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// InvalidDeleteRequest struct for InvalidDeleteRequest +type InvalidDeleteRequest struct { + // The error message tells you the cause of failure. + Message *string `json:"message,omitempty"` + // The parameter shows more information about where the error is. The number in the brackets is the invalid ID indexed. + Parameter *string `json:"parameter,omitempty"` +} diff --git a/rest/api/v3/integrations/model_invalid_request.go b/rest/api/v3/integrations/model_invalid_request.go new file mode 100644 index 00000000..9fae34ad --- /dev/null +++ b/rest/api/v3/integrations/model_invalid_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// InvalidRequest struct for InvalidRequest +type InvalidRequest struct { + // The error message tells you the cause of validation failure(s), separated by commas if there are multiple failures. + Message *string `json:"message,omitempty"` + // The field shows more information on where the error is when available. + Field *string `json:"field,omitempty"` +} diff --git a/rest/api/v3/integrations/model_items.go b/rest/api/v3/integrations/model_items.go new file mode 100644 index 00000000..c90149eb --- /dev/null +++ b/rest/api/v3/integrations/model_items.go @@ -0,0 +1,33 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items the model 'Items' +type Items string + +// List of Items +const ( + ITEMS_DROP Items = "drop" + ITEMS_PROCESSED Items = "processed" + ITEMS_DEFERRED Items = "deferred" + ITEMS_GROUP_UNSUBSCRIBE Items = "group_unsubscribe" + ITEMS_BOUNCE Items = "bounce" + ITEMS_DELIVERED Items = "delivered" + ITEMS_CLICK Items = "click" + ITEMS_UNSUBSCRIBE Items = "unsubscribe" + ITEMS_OPEN Items = "open" + ITEMS_GROUP_RESUBSCRIBE Items = "group_resubscribe" + ITEMS_SPAMREPORT Items = "spamreport" + ITEMS_MACHINE_OPENED Items = "machine_opened" +) diff --git a/rest/api/v3/integrations/model_items1.go b/rest/api/v3/integrations/model_items1.go new file mode 100644 index 00000000..ff8a80da --- /dev/null +++ b/rest/api/v3/integrations/model_items1.go @@ -0,0 +1,33 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items1 the model 'Items1' +type Items1 string + +// List of Items1 +const ( + ITEMS1_DROP Items1 = "drop" + ITEMS1_PROCESSED Items1 = "processed" + ITEMS1_DEFERRED Items1 = "deferred" + ITEMS1_GROUP_UNSUBSCRIBE Items1 = "group_unsubscribe" + ITEMS1_BOUNCE Items1 = "bounce" + ITEMS1_DELIVERED Items1 = "delivered" + ITEMS1_CLICK Items1 = "click" + ITEMS1_UNSUBSCRIBE Items1 = "unsubscribe" + ITEMS1_OPEN Items1 = "open" + ITEMS1_GROUP_RESUBSCRIBE Items1 = "group_resubscribe" + ITEMS1_SPAMREPORT Items1 = "spamreport" + ITEMS1_MACHINE_OPENED Items1 = "machine_opened" +) diff --git a/rest/api/v3/integrations/model_items2.go b/rest/api/v3/integrations/model_items2.go new file mode 100644 index 00000000..1cb6e646 --- /dev/null +++ b/rest/api/v3/integrations/model_items2.go @@ -0,0 +1,33 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Integrations API +* Integrations allows you to connect your SendGrid applications with third-party services and forward SendGrid email events to those external applications. Currently, Integrations supports event forwarding to [Segment](https://segment.com/docs). You can use this API to create, delete, view, and update your Integrations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items2 the model 'Items2' +type Items2 string + +// List of Items2 +const ( + ITEMS2_DROP Items2 = "drop" + ITEMS2_PROCESSED Items2 = "processed" + ITEMS2_DEFERRED Items2 = "deferred" + ITEMS2_GROUP_UNSUBSCRIBE Items2 = "group_unsubscribe" + ITEMS2_BOUNCE Items2 = "bounce" + ITEMS2_DELIVERED Items2 = "delivered" + ITEMS2_CLICK Items2 = "click" + ITEMS2_UNSUBSCRIBE Items2 = "unsubscribe" + ITEMS2_OPEN Items2 = "open" + ITEMS2_GROUP_RESUBSCRIBE Items2 = "group_resubscribe" + ITEMS2_SPAMREPORT Items2 = "spamreport" + ITEMS2_MACHINE_OPENED Items2 = "machine_opened" +) diff --git a/rest/api/v3/ip_access_management/README.md b/rest/api/v3/ip_access_management/README.md new file mode 100644 index 00000000..3636ea94 --- /dev/null +++ b/rest/api/v3/ip_access_management/README.md @@ -0,0 +1,79 @@ +# Go API client for + +IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. + +There is no limit to the number of IP addresses that you can allow. + +It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. + +See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.499792+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AddIpToAllowList* | [**AddIpToAllowList**](docs/AddIpToAllowList.md#addiptoallowlist) | **Post** /v3/access_settings/whitelist | Add one or more IPs to the allow list +*DeleteAllowedIp* | [**DeleteAllowedIp**](docs/DeleteAllowedIp.md#deleteallowedip) | **Delete** /v3/access_settings/whitelist/{RuleId} | Remove a specific IP from the allowed list +*DeleteAllowedIps* | [**DeleteAllowedIps**](docs/DeleteAllowedIps.md#deleteallowedips) | **Delete** /v3/access_settings/whitelist | Remove one or more IPs from the allow list +*GetAllowedIp* | [**GetAllowedIp**](docs/GetAllowedIp.md#getallowedip) | **Get** /v3/access_settings/whitelist/{RuleId} | Retrieve a specific allowed IP +*ListAccessActivity* | [**ListAccessActivity**](docs/ListAccessActivity.md#listaccessactivity) | **Get** /v3/access_settings/activity | Retrieve all recent access attempts +*ListAllowedIp* | [**ListAllowedIp**](docs/ListAllowedIp.md#listallowedip) | **Get** /v3/access_settings/whitelist | Retrieve a list of currently allowed IPs + + +## Documentation For Models + + - [AddIpToAllowListRequest](AddIpToAllowListRequest.md) + - [AddIpToAllowListRequestIpsInner](AddIpToAllowListRequestIpsInner.md) + - [DeleteAllowedIpsRequest](DeleteAllowedIpsRequest.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [IpAccessManagement2xx](IpAccessManagement2xx.md) + - [IpAccessManagement2xxResultInner](IpAccessManagement2xxResultInner.md) + - [ListAccessActivity200Response](ListAccessActivity200Response.md) + - [ListAccessActivity200ResponseResultInner](ListAccessActivity200ResponseResultInner.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/ip_access_management/api_add_ip_to_allow_list.go b/rest/api/v3/ip_access_management/api_add_ip_to_allow_list.go new file mode 100644 index 00000000..7e402244 --- /dev/null +++ b/rest/api/v3/ip_access_management/api_add_ip_to_allow_list.go @@ -0,0 +1,98 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type AddIpToAllowListParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + AddIpToAllowListRequest *AddIpToAllowListRequest `json:"AddIpToAllowListRequest,omitempty"` +} + +func (params *AddIpToAllowListParam) SetOnbehalfof(Onbehalfof string) *AddIpToAllowListParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *AddIpToAllowListParam) SetAddIpToAllowListRequest(AddIpToAllowListRequest AddIpToAllowListRequest) *AddIpToAllowListParam { + params.AddIpToAllowListRequest = &AddIpToAllowListRequest + return params +} + +// **This endpoint allows you to add one or more allowed IP addresses.** To allow one or more IP addresses, pass them to this endpoint in an array. Once an IP address is added to your allow list, it will be assigned an `id` that can be used to remove the address. You can retrieve the ID associated with an IP using the \"Retrieve a list of currently allowed IPs\" endpoint. +func (c *ApiService) AddIpToAllowList(params *AddIpToAllowListParam) (interface{}, error) { + path := "/v3/access_settings/whitelist" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddIpToAllowListRequest != nil { + b, err := json.Marshal(*params.AddIpToAllowListRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &IpAccessManagement2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_access_management/api_delete_allowed_ip.go b/rest/api/v3/ip_access_management/api_delete_allowed_ip.go new file mode 100644 index 00000000..9691fb48 --- /dev/null +++ b/rest/api/v3/ip_access_management/api_delete_allowed_ip.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteAllowedIpParam struct { + // The ID of the allowed IP address that you want to retrieve. + RuleId *string `json:"rule_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteAllowedIpParam) SetRuleId(RuleId string) *DeleteAllowedIpParam { + params.RuleId = &RuleId + return params +} +func (params *DeleteAllowedIpParam) SetOnbehalfof(Onbehalfof string) *DeleteAllowedIpParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to remove a specific IP address from your list of allowed addresses.** When removing a specific IP address from your list, you must include the ID in your call. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint. +func (c *ApiService) DeleteAllowedIp(params *DeleteAllowedIpParam) (interface{}, error) { + path := "/v3/access_settings/whitelist/{RuleId}" + if params != nil && params.RuleId != nil { + path = strings.Replace(path, "{"+"RuleId"+"}", *params.RuleId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_access_management/api_delete_allowed_ips.go b/rest/api/v3/ip_access_management/api_delete_allowed_ips.go new file mode 100644 index 00000000..83fb95f5 --- /dev/null +++ b/rest/api/v3/ip_access_management/api_delete_allowed_ips.go @@ -0,0 +1,98 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type DeleteAllowedIpsParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + DeleteAllowedIpsRequest *DeleteAllowedIpsRequest `json:"DeleteAllowedIpsRequest,omitempty"` +} + +func (params *DeleteAllowedIpsParam) SetOnbehalfof(Onbehalfof string) *DeleteAllowedIpsParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *DeleteAllowedIpsParam) SetDeleteAllowedIpsRequest(DeleteAllowedIpsRequest DeleteAllowedIpsRequest) *DeleteAllowedIpsParam { + params.DeleteAllowedIpsRequest = &DeleteAllowedIpsRequest + return params +} + +// **This endpoint allows you to remove one or more IP addresses from your list of allowed addresses.** To remove one or more IP addresses, pass this endpoint an array containing the ID(s) associated with the IP(s) you intend to remove. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint. It is possible to remove your own IP address, which will block access to your account. You will need to submit a [support ticket](https://sendgrid.com/docs/ui/account-and-settings/support/) if this happens. For this reason, it is important to double check that you are removing only the IPs you intend to remove when using this endpoint. +func (c *ApiService) DeleteAllowedIps(params *DeleteAllowedIpsParam) (interface{}, error) { + path := "/v3/access_settings/whitelist" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DeleteAllowedIpsRequest != nil { + b, err := json.Marshal(*params.DeleteAllowedIpsRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_access_management/api_get_allowed_ip.go b/rest/api/v3/ip_access_management/api_get_allowed_ip.go new file mode 100644 index 00000000..bbe20e9c --- /dev/null +++ b/rest/api/v3/ip_access_management/api_get_allowed_ip.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetAllowedIpParam struct { + // The ID of the allowed IP address that you want to retrieve. + RuleId *string `json:"rule_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetAllowedIpParam) SetRuleId(RuleId string) *GetAllowedIpParam { + params.RuleId = &RuleId + return params +} +func (params *GetAllowedIpParam) SetOnbehalfof(Onbehalfof string) *GetAllowedIpParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retreive a specific IP address that has been allowed to access your account.** You must include the ID for the specific IP address you want to retrieve in your call. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint. +func (c *ApiService) GetAllowedIp(params *GetAllowedIpParam) (interface{}, error) { + path := "/v3/access_settings/whitelist/{RuleId}" + if params != nil && params.RuleId != nil { + path = strings.Replace(path, "{"+"RuleId"+"}", *params.RuleId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &IpAccessManagement2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_access_management/api_list_access_activity.go b/rest/api/v3/ip_access_management/api_list_access_activity.go new file mode 100644 index 00000000..1a9acf1a --- /dev/null +++ b/rest/api/v3/ip_access_management/api_list_access_activity.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListAccessActivityParam struct { + // Limits the number of IPs to return. + Limit *int32 `json:"limit,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListAccessActivityParam) SetLimit(Limit int32) *ListAccessActivityParam { + params.Limit = &Limit + return params +} +func (params *ListAccessActivityParam) SetOnbehalfof(Onbehalfof string) *ListAccessActivityParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a list of all of the IP addresses that recently attempted to access your account either through the User Interface or the API.** +func (c *ApiService) ListAccessActivity(params *ListAccessActivityParam) (interface{}, error) { + path := "/v3/access_settings/activity" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListAccessActivity200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_access_management/api_list_allowed_ip.go b/rest/api/v3/ip_access_management/api_list_allowed_ip.go new file mode 100644 index 00000000..f9dc1611 --- /dev/null +++ b/rest/api/v3/ip_access_management/api_list_allowed_ip.go @@ -0,0 +1,83 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListAllowedIpParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListAllowedIpParam) SetOnbehalfof(Onbehalfof string) *ListAllowedIpParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a list of IP addresses that are currently allowed to access your account.** Each IP address returned to you will have `created_at` and `updated_at` dates. Each IP will also be associated with an `id` that can be used to remove the address from your allow list. +func (c *ApiService) ListAllowedIp(params *ListAllowedIpParam) (interface{}, error) { + path := "/v3/access_settings/whitelist" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &IpAccessManagement2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_access_management/api_service.go b/rest/api/v3/ip_access_management/api_service.go new file mode 100644 index 00000000..d43663e0 --- /dev/null +++ b/rest/api/v3/ip_access_management/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/ip_access_management/docs/AddIpToAllowList.md b/rest/api/v3/ip_access_management/docs/AddIpToAllowList.md new file mode 100644 index 00000000..71f14dd1 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/AddIpToAllowList.md @@ -0,0 +1,49 @@ +# AddIpToAllowList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddIpToAllowList**](AddIpToAllowList.md#AddIpToAllowList) | **Post** /v3/access_settings/whitelist | Add one or more IPs to the allow list + + + +## AddIpToAllowList + +> IpAccessManagement2xx AddIpToAllowList(ctx, optional) + +Add one or more IPs to the allow list + +**This endpoint allows you to add one or more allowed IP addresses.** To allow one or more IP addresses, pass them to this endpoint in an array. Once an IP address is added to your allow list, it will be assigned an `id` that can be used to remove the address. You can retrieve the ID associated with an IP using the \"Retrieve a list of currently allowed IPs\" endpoint. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a AddIpToAllowListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**AddIpToAllowListRequest** | [**AddIpToAllowListRequest**](AddIpToAllowListRequest.md) | + +### Return type + +[**IpAccessManagement2xx**](IpAccessManagement2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_access_management/docs/AddIpToAllowListRequest.md b/rest/api/v3/ip_access_management/docs/AddIpToAllowListRequest.md new file mode 100644 index 00000000..f4318398 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/AddIpToAllowListRequest.md @@ -0,0 +1,11 @@ +# AddIpToAllowListRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ips** | [**[]AddIpToAllowListRequestIpsInner**](AddIpToAllowListRequestIpsInner.md) | An array containing the IP(s) you want to allow. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/AddIpToAllowListRequestIpsInner.md b/rest/api/v3/ip_access_management/docs/AddIpToAllowListRequestIpsInner.md new file mode 100644 index 00000000..7f0dc81f --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/AddIpToAllowListRequestIpsInner.md @@ -0,0 +1,11 @@ +# AddIpToAllowListRequestIpsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | An IP address that you want to allow. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/DeleteAllowedIp.md b/rest/api/v3/ip_access_management/docs/DeleteAllowedIp.md new file mode 100644 index 00000000..64cf1795 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/DeleteAllowedIp.md @@ -0,0 +1,52 @@ +# DeleteAllowedIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteAllowedIp**](DeleteAllowedIp.md#DeleteAllowedIp) | **Delete** /v3/access_settings/whitelist/{RuleId} | Remove a specific IP from the allowed list + + + +## DeleteAllowedIp + +> map[string]interface{} DeleteAllowedIp(ctx, RuleIdoptional) + +Remove a specific IP from the allowed list + +**This endpoint allows you to remove a specific IP address from your list of allowed addresses.** When removing a specific IP address from your list, you must include the ID in your call. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**RuleId** | **string** | The ID of the allowed IP address that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteAllowedIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_access_management/docs/DeleteAllowedIps.md b/rest/api/v3/ip_access_management/docs/DeleteAllowedIps.md new file mode 100644 index 00000000..ffe7222a --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/DeleteAllowedIps.md @@ -0,0 +1,49 @@ +# DeleteAllowedIps + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteAllowedIps**](DeleteAllowedIps.md#DeleteAllowedIps) | **Delete** /v3/access_settings/whitelist | Remove one or more IPs from the allow list + + + +## DeleteAllowedIps + +> map[string]interface{} DeleteAllowedIps(ctx, optional) + +Remove one or more IPs from the allow list + +**This endpoint allows you to remove one or more IP addresses from your list of allowed addresses.** To remove one or more IP addresses, pass this endpoint an array containing the ID(s) associated with the IP(s) you intend to remove. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint. It is possible to remove your own IP address, which will block access to your account. You will need to submit a [support ticket](https://sendgrid.com/docs/ui/account-and-settings/support/) if this happens. For this reason, it is important to double check that you are removing only the IPs you intend to remove when using this endpoint. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteAllowedIpsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**DeleteAllowedIpsRequest** | [**DeleteAllowedIpsRequest**](DeleteAllowedIpsRequest.md) | + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_access_management/docs/DeleteAllowedIpsRequest.md b/rest/api/v3/ip_access_management/docs/DeleteAllowedIpsRequest.md new file mode 100644 index 00000000..9c466261 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/DeleteAllowedIpsRequest.md @@ -0,0 +1,11 @@ +# DeleteAllowedIpsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ids** | **[]int32** | An array of the IDs of the IP address that you want to remove from your allow list. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/ErrorResponse.md b/rest/api/v3/ip_access_management/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/ErrorResponseErrorsInner.md b/rest/api/v3/ip_access_management/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/GetAllowedIp.md b/rest/api/v3/ip_access_management/docs/GetAllowedIp.md new file mode 100644 index 00000000..4ea75448 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/GetAllowedIp.md @@ -0,0 +1,52 @@ +# GetAllowedIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetAllowedIp**](GetAllowedIp.md#GetAllowedIp) | **Get** /v3/access_settings/whitelist/{RuleId} | Retrieve a specific allowed IP + + + +## GetAllowedIp + +> IpAccessManagement2xx GetAllowedIp(ctx, RuleIdoptional) + +Retrieve a specific allowed IP + +**This endpoint allows you to retreive a specific IP address that has been allowed to access your account.** You must include the ID for the specific IP address you want to retrieve in your call. You can retrieve the IDs associated with your allowed IP addresses using the \"Retrieve a list of currently allowed IPs\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**RuleId** | **string** | The ID of the allowed IP address that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetAllowedIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**IpAccessManagement2xx**](IpAccessManagement2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_access_management/docs/IpAccessManagement2xx.md b/rest/api/v3/ip_access_management/docs/IpAccessManagement2xx.md new file mode 100644 index 00000000..5391826f --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/IpAccessManagement2xx.md @@ -0,0 +1,11 @@ +# IpAccessManagement2xx + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]IpAccessManagement2xxResultInner**](IpAccessManagement2xxResultInner.md) | An array listing one or more of your allowed IPs. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/IpAccessManagement2xxResultInner.md b/rest/api/v3/ip_access_management/docs/IpAccessManagement2xxResultInner.md new file mode 100644 index 00000000..853651fa --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/IpAccessManagement2xxResultInner.md @@ -0,0 +1,14 @@ +# IpAccessManagement2xxResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the allowed IP. |[optional] +**Ip** | **string** | The allowed IP. |[optional] +**CreatedAt** | **int32** | A Unix timestamp indicating when the IP was added to the allow list. |[optional] +**UpdatedAt** | **int32** | A Unix timestamp indicating when the IPs allow status was most recently updated. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/ListAccessActivity.md b/rest/api/v3/ip_access_management/docs/ListAccessActivity.md new file mode 100644 index 00000000..ef433ccb --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/ListAccessActivity.md @@ -0,0 +1,49 @@ +# ListAccessActivity + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAccessActivity**](ListAccessActivity.md#ListAccessActivity) | **Get** /v3/access_settings/activity | Retrieve all recent access attempts + + + +## ListAccessActivity + +> ListAccessActivity200Response ListAccessActivity(ctx, optional) + +Retrieve all recent access attempts + +**This endpoint allows you to retrieve a list of all of the IP addresses that recently attempted to access your account either through the User Interface or the API.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAccessActivityParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | Limits the number of IPs to return. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListAccessActivity200Response**](ListAccessActivity200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_access_management/docs/ListAccessActivity200Response.md b/rest/api/v3/ip_access_management/docs/ListAccessActivity200Response.md new file mode 100644 index 00000000..b78a8525 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/ListAccessActivity200Response.md @@ -0,0 +1,11 @@ +# ListAccessActivity200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListAccessActivity200ResponseResultInner**](ListAccessActivity200ResponseResultInner.md) | An array containing the IPs that recently attempted to access your account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/ListAccessActivity200ResponseResultInner.md b/rest/api/v3/ip_access_management/docs/ListAccessActivity200ResponseResultInner.md new file mode 100644 index 00000000..8ca798d0 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/ListAccessActivity200ResponseResultInner.md @@ -0,0 +1,16 @@ +# ListAccessActivity200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Allowed** | **bool** | Indicates if the IP address was granted access to the account. | +**AuthMethod** | **string** | The authentication method used when attempting access. | +**FirstAt** | **int32** | A Unix timestamp indicating when the first access attempt was made. | +**Ip** | **string** | The IP addressed used during the access attempt. | +**LastAt** | **int32** | A Unix timestamp indicating when the most recent access attempt was made | +**Location** | **string** | The geographic location from which the access attempt originated. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_access_management/docs/ListAllowedIp.md b/rest/api/v3/ip_access_management/docs/ListAllowedIp.md new file mode 100644 index 00000000..00008876 --- /dev/null +++ b/rest/api/v3/ip_access_management/docs/ListAllowedIp.md @@ -0,0 +1,48 @@ +# ListAllowedIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAllowedIp**](ListAllowedIp.md#ListAllowedIp) | **Get** /v3/access_settings/whitelist | Retrieve a list of currently allowed IPs + + + +## ListAllowedIp + +> IpAccessManagement2xx ListAllowedIp(ctx, optional) + +Retrieve a list of currently allowed IPs + +**This endpoint allows you to retrieve a list of IP addresses that are currently allowed to access your account.** Each IP address returned to you will have `created_at` and `updated_at` dates. Each IP will also be associated with an `id` that can be used to remove the address from your allow list. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAllowedIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**IpAccessManagement2xx**](IpAccessManagement2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request.go b/rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request.go new file mode 100644 index 00000000..023d725d --- /dev/null +++ b/rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpToAllowListRequest struct for AddIpToAllowListRequest +type AddIpToAllowListRequest struct { + // An array containing the IP(s) you want to allow. + Ips []AddIpToAllowListRequestIpsInner `json:"ips"` +} diff --git a/rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request_ips_inner.go b/rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request_ips_inner.go new file mode 100644 index 00000000..34ad310c --- /dev/null +++ b/rest/api/v3/ip_access_management/model_add_ip_to_allow_list_request_ips_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpToAllowListRequestIpsInner struct for AddIpToAllowListRequestIpsInner +type AddIpToAllowListRequestIpsInner struct { + // An IP address that you want to allow. + Ip string `json:"ip"` +} diff --git a/rest/api/v3/ip_access_management/model_delete_allowed_ips_request.go b/rest/api/v3/ip_access_management/model_delete_allowed_ips_request.go new file mode 100644 index 00000000..ceba5206 --- /dev/null +++ b/rest/api/v3/ip_access_management/model_delete_allowed_ips_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteAllowedIpsRequest struct for DeleteAllowedIpsRequest +type DeleteAllowedIpsRequest struct { + // An array of the IDs of the IP address that you want to remove from your allow list. + Ids *[]int32 `json:"ids,omitempty"` +} diff --git a/rest/api/v3/ip_access_management/model_error_response.go b/rest/api/v3/ip_access_management/model_error_response.go new file mode 100644 index 00000000..025b609b --- /dev/null +++ b/rest/api/v3/ip_access_management/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/ip_access_management/model_error_response_errors_inner.go b/rest/api/v3/ip_access_management/model_error_response_errors_inner.go new file mode 100644 index 00000000..02c85e55 --- /dev/null +++ b/rest/api/v3/ip_access_management/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/ip_access_management/model_ip_access_management2xx.go b/rest/api/v3/ip_access_management/model_ip_access_management2xx.go new file mode 100644 index 00000000..868be517 --- /dev/null +++ b/rest/api/v3/ip_access_management/model_ip_access_management2xx.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IpAccessManagement2xx struct for IpAccessManagement2xx +type IpAccessManagement2xx struct { + // An array listing one or more of your allowed IPs. + Result *[]IpAccessManagement2xxResultInner `json:"result,omitempty"` +} diff --git a/rest/api/v3/ip_access_management/model_ip_access_management2xx_result_inner.go b/rest/api/v3/ip_access_management/model_ip_access_management2xx_result_inner.go new file mode 100644 index 00000000..ea547bb2 --- /dev/null +++ b/rest/api/v3/ip_access_management/model_ip_access_management2xx_result_inner.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IpAccessManagement2xxResultInner struct for IpAccessManagement2xxResultInner +type IpAccessManagement2xxResultInner struct { + // The ID of the allowed IP. + Id *int32 `json:"id,omitempty"` + // The allowed IP. + Ip *string `json:"ip,omitempty"` + // A Unix timestamp indicating when the IP was added to the allow list. + CreatedAt *int32 `json:"created_at,omitempty"` + // A Unix timestamp indicating when the IPs allow status was most recently updated. + UpdatedAt *int32 `json:"updated_at,omitempty"` +} diff --git a/rest/api/v3/ip_access_management/model_list_access_activity_200_response.go b/rest/api/v3/ip_access_management/model_list_access_activity_200_response.go new file mode 100644 index 00000000..f39f3d16 --- /dev/null +++ b/rest/api/v3/ip_access_management/model_list_access_activity_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAccessActivity200Response struct for ListAccessActivity200Response +type ListAccessActivity200Response struct { + // An array containing the IPs that recently attempted to access your account. + Result []ListAccessActivity200ResponseResultInner `json:"result"` +} diff --git a/rest/api/v3/ip_access_management/model_list_access_activity_200_response_result_inner.go b/rest/api/v3/ip_access_management/model_list_access_activity_200_response_result_inner.go new file mode 100644 index 00000000..b1a28ff3 --- /dev/null +++ b/rest/api/v3/ip_access_management/model_list_access_activity_200_response_result_inner.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Access Management API +* IP Twilio SendGrid IP Access Management API allows you to control which IP addresses can be used to access your account, either through the SendGrid application user interface or the API. There is no limit to the number of IP addresses that you can allow. It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously and wish to prevent any 'bad actors' from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. See [**IP Access Management**](https://docs.sendgrid.com/ui/account-and-settings/ip-access-management) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAccessActivity200ResponseResultInner struct for ListAccessActivity200ResponseResultInner +type ListAccessActivity200ResponseResultInner struct { + // Indicates if the IP address was granted access to the account. + Allowed bool `json:"allowed"` + // The authentication method used when attempting access. + AuthMethod string `json:"auth_method"` + // A Unix timestamp indicating when the first access attempt was made. + FirstAt int32 `json:"first_at"` + // The IP addressed used during the access attempt. + Ip string `json:"ip"` + // A Unix timestamp indicating when the most recent access attempt was made + LastAt int32 `json:"last_at"` + // The geographic location from which the access attempt originated. + Location string `json:"location"` +} diff --git a/rest/api/v3/ip_address_management/README.md b/rest/api/v3/ip_address_management/README.md new file mode 100644 index 00000000..33791ae1 --- /dev/null +++ b/rest/api/v3/ip_address_management/README.md @@ -0,0 +1,118 @@ +# Go API client for + +The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.519876+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AddIp* | [**AddIp**](docs/AddIp.md#addip) | **Post** /v3/send_ips/ips | Add a Twilio SendGrid IP Address +*AddIpsToIpPool* | [**AddIpsToIpPool**](docs/AddIpsToIpPool.md#addipstoippool) | **Post** /v3/send_ips/pools/{Poolid}/ips:batchAdd | Add a Batch of IPs to an IP Pool +*AddSubUsersToIp* | [**AddSubUsersToIp**](docs/AddSubUsersToIp.md#addsubuserstoip) | **Post** /v3/send_ips/ips/{Ip}/subusers:batchAdd | Assign a Batch of Subusers to an IP +*CreateIpPool* | [**CreateIpPool**](docs/CreateIpPool.md#createippool) | **Post** /v3/send_ips/pools | Create an IP Pool with a Name and IP Assignments +*DeleteIpPool* | [**DeleteIpPool**](docs/DeleteIpPool.md#deleteippool) | **Delete** /v3/send_ips/pools/{Poolid} | Delete IP Pool +*DeleteIpsFromIpPool* | [**DeleteIpsFromIpPool**](docs/DeleteIpsFromIpPool.md#deleteipsfromippool) | **Post** /v3/send_ips/pools/{Poolid}/ips:batchDelete | Delete a Batch of IPs from an IP Pool +*DeleteSubUsersFromIp* | [**DeleteSubUsersFromIp**](docs/DeleteSubUsersFromIp.md#deletesubusersfromip) | **Post** /v3/send_ips/ips/{Ip}/subusers:batchDelete | Delete a Batch of Subusers from an IP +*GetIp* | [**GetIp**](docs/GetIp.md#getip) | **Get** /v3/send_ips/ips/{Ip} | Get Details for an IP Address +*GetIpPool* | [**GetIpPool**](docs/GetIpPool.md#getippool) | **Get** /v3/send_ips/pools/{Poolid} | Get Details for an IP Pool +*ListIp* | [**ListIp**](docs/ListIp.md#listip) | **Get** /v3/send_ips/ips | Get a List of all IP Addresses on your Account +*ListIpAssignedToIpPool* | [**ListIpAssignedToIpPool**](docs/ListIpAssignedToIpPool.md#listipassignedtoippool) | **Get** /v3/send_ips/pools/{Poolid}/ips | Get IPs Assigned to an IP Pool +*ListIpPool* | [**ListIpPool**](docs/ListIpPool.md#listippool) | **Get** /v3/send_ips/pools | GET all IP Pools that have Associated IPs +*ListSubUserAssignedToIp* | [**ListSubUserAssignedToIp**](docs/ListSubUserAssignedToIp.md#listsubuserassignedtoip) | **Get** /v3/send_ips/ips/{Ip}/subusers | Get a List of Subusers Assigned to an IP +*UpdateIp* | [**UpdateIp**](docs/UpdateIp.md#updateip) | **Patch** /v3/send_ips/ips/{Ip} | Update Details for an IP Address +*UpdateIpPool* | [**UpdateIpPool**](docs/UpdateIpPool.md#updateippool) | **Put** /v3/send_ips/pools/{Poolid} | Update an IP Pool Name + + +## Documentation For Models + + - [AddIp201Response](AddIp201Response.md) + - [AddIpRequest](AddIpRequest.md) + - [AddIpsToIpPool200Response](AddIpsToIpPool200Response.md) + - [AddIpsToIpPoolRequest](AddIpsToIpPoolRequest.md) + - [AddSubUsersToIp200Response](AddSubUsersToIp200Response.md) + - [AddSubUsersToIpRequest](AddSubUsersToIpRequest.md) + - [CreateIpPool201Response](CreateIpPool201Response.md) + - [CreateIpPoolRequest](CreateIpPoolRequest.md) + - [DeleteIpsFromIpPoolRequest](DeleteIpsFromIpPoolRequest.md) + - [DeleteSubUsersFromIpRequest](DeleteSubUsersFromIpRequest.md) + - [GetIp200Response](GetIp200Response.md) + - [GetIp200ResponsePoolsInner](GetIp200ResponsePoolsInner.md) + - [GetIpPool200Response](GetIpPool200Response.md) + - [GetIpPool200ResponseIpCountByRegionInner](GetIpPool200ResponseIpCountByRegionInner.md) + - [IpAddressManagementErrorResponse](IpAddressManagementErrorResponse.md) + - [IpAddressManagementErrorResponseErrorsInner](IpAddressManagementErrorResponseErrorsInner.md) + - [Items](Items.md) + - [ListIp200Response](ListIp200Response.md) + - [ListIp200ResponseMetadata](ListIp200ResponseMetadata.md) + - [ListIp200ResponseMetadataNextParams](ListIp200ResponseMetadataNextParams.md) + - [ListIp200ResponseResultInner](ListIp200ResponseResultInner.md) + - [ListIp200ResponseResultInnerPoolsInner](ListIp200ResponseResultInnerPoolsInner.md) + - [ListIpAssignedToIpPool200Response](ListIpAssignedToIpPool200Response.md) + - [ListIpAssignedToIpPool200ResponseMetadata](ListIpAssignedToIpPool200ResponseMetadata.md) + - [ListIpAssignedToIpPool200ResponseMetadataNextParams](ListIpAssignedToIpPool200ResponseMetadataNextParams.md) + - [ListIpAssignedToIpPool200ResponseResultInner](ListIpAssignedToIpPool200ResponseResultInner.md) + - [ListIpPool200Response](ListIpPool200Response.md) + - [ListIpPool200ResponseMetadata](ListIpPool200ResponseMetadata.md) + - [ListIpPool200ResponseMetadataNextParams](ListIpPool200ResponseMetadataNextParams.md) + - [ListIpPool200ResponseResultInner](ListIpPool200ResponseResultInner.md) + - [ListSubUserAssignedToIp200Response](ListSubUserAssignedToIp200Response.md) + - [ListSubUserAssignedToIp200ResponseMetadata](ListSubUserAssignedToIp200ResponseMetadata.md) + - [ListSubUserAssignedToIp200ResponseMetadataNextParams](ListSubUserAssignedToIp200ResponseMetadataNextParams.md) + - [Region](Region.md) + - [Region1](Region1.md) + - [Region2](Region2.md) + - [Region3](Region3.md) + - [Region4](Region4.md) + - [Region5](Region5.md) + - [Region6](Region6.md) + - [Region7](Region7.md) + - [UpdateIp200Response](UpdateIp200Response.md) + - [UpdateIpPool200Response](UpdateIpPool200Response.md) + - [UpdateIpPoolRequest](UpdateIpPoolRequest.md) + - [UpdateIpRequest](UpdateIpRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/ip_address_management/api_add_ip.go b/rest/api/v3/ip_address_management/api_add_ip.go new file mode 100644 index 00000000..d54f9095 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_add_ip.go @@ -0,0 +1,89 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type AddIpParam struct { + // + AddIpRequest *AddIpRequest `json:"AddIpRequest,omitempty"` +} + +func (params *AddIpParam) SetAddIpRequest(AddIpRequest AddIpRequest) *AddIpParam { + params.AddIpRequest = &AddIpRequest + return params +} + +// This operation adds a Twilio SendGrid IP address to your account. You can also assign up to 100 Subusers to the IP address at creation. +func (c *ApiService) AddIp(params *AddIpParam) (interface{}, error) { + path := "/v3/send_ips/ips" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddIpRequest != nil { + b, err := json.Marshal(*params.AddIpRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &AddIp201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_add_ips_to_ip_pool.go b/rest/api/v3/ip_address_management/api_add_ips_to_ip_pool.go new file mode 100644 index 00000000..fac88fba --- /dev/null +++ b/rest/api/v3/ip_address_management/api_add_ips_to_ip_pool.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type AddIpsToIpPoolParam struct { + // Specifies the unique ID for an IP Pool. + Poolid *string `json:"poolid"` + // + AddIpsToIpPoolRequest *AddIpsToIpPoolRequest `json:"AddIpsToIpPoolRequest,omitempty"` +} + +func (params *AddIpsToIpPoolParam) SetPoolid(Poolid string) *AddIpsToIpPoolParam { + params.Poolid = &Poolid + return params +} +func (params *AddIpsToIpPoolParam) SetAddIpsToIpPoolRequest(AddIpsToIpPoolRequest AddIpsToIpPoolRequest) *AddIpsToIpPoolParam { + params.AddIpsToIpPoolRequest = &AddIpsToIpPoolRequest + return params +} + +// This operation appends a batch of IPs to an IP Pool. This operation requires all IP assignments to succeed. If any IP assignments fail, this endpoint will return an error. +func (c *ApiService) AddIpsToIpPool(params *AddIpsToIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools/{Poolid}/ips:batchAdd" + if params != nil && params.Poolid != nil { + path = strings.Replace(path, "{"+"Poolid"+"}", *params.Poolid, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddIpsToIpPoolRequest != nil { + b, err := json.Marshal(*params.AddIpsToIpPoolRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AddIpsToIpPool200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_add_sub_users_to_ip.go b/rest/api/v3/ip_address_management/api_add_sub_users_to_ip.go new file mode 100644 index 00000000..9d7ee407 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_add_sub_users_to_ip.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type AddSubUsersToIpParam struct { + // The `ip` path parameter specifies an IP address to make the request against. + Ip *string `json:"ip"` + // + AddSubUsersToIpRequest *AddSubUsersToIpRequest `json:"AddSubUsersToIpRequest,omitempty"` +} + +func (params *AddSubUsersToIpParam) SetIp(Ip string) *AddSubUsersToIpParam { + params.Ip = &Ip + return params +} +func (params *AddSubUsersToIpParam) SetAddSubUsersToIpRequest(AddSubUsersToIpRequest AddSubUsersToIpRequest) *AddSubUsersToIpParam { + params.AddSubUsersToIpRequest = &AddSubUsersToIpRequest + return params +} + +// This operation appends a batch of Subusers to a specified IP address. This endpoint requires all Subuser assignments to succeed. If a Subuser assignment fails, this endpoint will return an error. +func (c *ApiService) AddSubUsersToIp(params *AddSubUsersToIpParam) (interface{}, error) { + path := "/v3/send_ips/ips/{Ip}/subusers:batchAdd" + if params != nil && params.Ip != nil { + path = strings.Replace(path, "{"+"Ip"+"}", *params.Ip, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddSubUsersToIpRequest != nil { + b, err := json.Marshal(*params.AddSubUsersToIpRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AddSubUsersToIp200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_create_ip_pool.go b/rest/api/v3/ip_address_management/api_create_ip_pool.go new file mode 100644 index 00000000..bffe9a8a --- /dev/null +++ b/rest/api/v3/ip_address_management/api_create_ip_pool.go @@ -0,0 +1,89 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateIpPoolParam struct { + // + CreateIpPoolRequest *CreateIpPoolRequest `json:"CreateIpPoolRequest,omitempty"` +} + +func (params *CreateIpPoolParam) SetCreateIpPoolRequest(CreateIpPoolRequest CreateIpPoolRequest) *CreateIpPoolParam { + params.CreateIpPoolRequest = &CreateIpPoolRequest + return params +} + +// This operation will create a named IP Pool and associate specified IP addresses with the newly created Pool. This operation requires all IP assignments to succeed. If any IP assignments fail, this endpoint will return an error and the Pool will not be created. Each IP Pool may have a maximum of 100 assigned IP addresses. +func (c *ApiService) CreateIpPool(params *CreateIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateIpPoolRequest != nil { + b, err := json.Marshal(*params.CreateIpPoolRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &CreateIpPool201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_delete_ip_pool.go b/rest/api/v3/ip_address_management/api_delete_ip_pool.go new file mode 100644 index 00000000..9f6ac8c1 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_delete_ip_pool.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteIpPoolParam struct { + // Specifies the unique ID for an IP Pool. + Poolid *string `json:"poolid"` +} + +func (params *DeleteIpPoolParam) SetPoolid(Poolid string) *DeleteIpPoolParam { + params.Poolid = &Poolid + return params +} + +// This operation deletes an IP Pool and unassigns all IP addresses associated with the Pool. IP addresses associated with the deleted Pool will remain in your account. +func (c *ApiService) DeleteIpPool(params *DeleteIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools/{Poolid}" + if params != nil && params.Poolid != nil { + path = strings.Replace(path, "{"+"Poolid"+"}", *params.Poolid, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_delete_ips_from_ip_pool.go b/rest/api/v3/ip_address_management/api_delete_ips_from_ip_pool.go new file mode 100644 index 00000000..95bb7bc8 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_delete_ips_from_ip_pool.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteIpsFromIpPoolParam struct { + // Specifies the unique ID for an IP Pool. + Poolid *string `json:"poolid"` + // + DeleteIpsFromIpPoolRequest *DeleteIpsFromIpPoolRequest `json:"DeleteIpsFromIpPoolRequest,omitempty"` +} + +func (params *DeleteIpsFromIpPoolParam) SetPoolid(Poolid string) *DeleteIpsFromIpPoolParam { + params.Poolid = &Poolid + return params +} +func (params *DeleteIpsFromIpPoolParam) SetDeleteIpsFromIpPoolRequest(DeleteIpsFromIpPoolRequest DeleteIpsFromIpPoolRequest) *DeleteIpsFromIpPoolParam { + params.DeleteIpsFromIpPoolRequest = &DeleteIpsFromIpPoolRequest + return params +} + +// This operation removes a batch of IPs from an IP Pool. All IPs associated with the Pool will be unassigned from the deleted Pool. However, this operation does not remove the IPs from your account. +func (c *ApiService) DeleteIpsFromIpPool(params *DeleteIpsFromIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools/{Poolid}/ips:batchDelete" + if params != nil && params.Poolid != nil { + path = strings.Replace(path, "{"+"Poolid"+"}", *params.Poolid, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DeleteIpsFromIpPoolRequest != nil { + b, err := json.Marshal(*params.DeleteIpsFromIpPoolRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_delete_sub_users_from_ip.go b/rest/api/v3/ip_address_management/api_delete_sub_users_from_ip.go new file mode 100644 index 00000000..aef499b7 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_delete_sub_users_from_ip.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteSubUsersFromIpParam struct { + // The `ip` path parameter specifies an IP address to make the request against. + Ip *string `json:"ip"` + // + DeleteSubUsersFromIpRequest *DeleteSubUsersFromIpRequest `json:"DeleteSubUsersFromIpRequest,omitempty"` +} + +func (params *DeleteSubUsersFromIpParam) SetIp(Ip string) *DeleteSubUsersFromIpParam { + params.Ip = &Ip + return params +} +func (params *DeleteSubUsersFromIpParam) SetDeleteSubUsersFromIpRequest(DeleteSubUsersFromIpRequest DeleteSubUsersFromIpRequest) *DeleteSubUsersFromIpParam { + params.DeleteSubUsersFromIpRequest = &DeleteSubUsersFromIpRequest + return params +} + +// This operation removes a batch of Subusers from a specified IP address. +func (c *ApiService) DeleteSubUsersFromIp(params *DeleteSubUsersFromIpParam) (interface{}, error) { + path := "/v3/send_ips/ips/{Ip}/subusers:batchDelete" + if params != nil && params.Ip != nil { + path = strings.Replace(path, "{"+"Ip"+"}", *params.Ip, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DeleteSubUsersFromIpRequest != nil { + b, err := json.Marshal(*params.DeleteSubUsersFromIpRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_get_ip.go b/rest/api/v3/ip_address_management/api_get_ip.go new file mode 100644 index 00000000..5a87786b --- /dev/null +++ b/rest/api/v3/ip_address_management/api_get_ip.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type GetIpParam struct { + // Boolean indicating whether or not to return the IP Pool's region information in the response. + IncludeRegion *bool `json:"include_region,omitempty"` +} + +func (params *GetIpParam) SetIncludeRegion(IncludeRegion bool) *GetIpParam { + params.IncludeRegion = &IncludeRegion + return params +} + +// This operation returns details for a specified IP address. Details include whether the IP is assigned to a parent account, set to warm up automatically, which Pools the IP is associated with, when the IP was added and modified, whether the IP is leased, and whether the IP is enabled. Note that this operation will not return Subuser information associated with the IP. To retrieve Subuser information, use the \"Get a List of Subusers Assigned to an IP\" endpoint. +func (c *ApiService) GetIp(params *GetIpParam) (interface{}, error) { + path := "/v3/send_ips/ips/{Ip}" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.IncludeRegion != nil { + data.Set("include_region", fmt.Sprint(*params.IncludeRegion)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetIp200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_get_ip_pool.go b/rest/api/v3/ip_address_management/api_get_ip_pool.go new file mode 100644 index 00000000..a3272515 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_get_ip_pool.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type GetIpPoolParam struct { + // Boolean indicating whether or not to return the IP Pool's region information in the response. + IncludeRegion *bool `json:"include_region,omitempty"` +} + +func (params *GetIpPoolParam) SetIncludeRegion(IncludeRegion bool) *GetIpPoolParam { + params.IncludeRegion = &IncludeRegion + return params +} + +// This operation will return the details for a specified IP Pool, including the Pool's name, ID, a sample list of the IPs associated with the Pool, and the total number of IPs belonging to the Pool. A maximum of 10 IPs will be returned per IP Pool by default. To retrieve additional IP addresses associated with a Pool, use the \"Get IPs Assigned to an IP Pool\" operation. +func (c *ApiService) GetIpPool(params *GetIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools/{Poolid}" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.IncludeRegion != nil { + data.Set("include_region", fmt.Sprint(*params.IncludeRegion)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetIpPool200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_list_ip.go b/rest/api/v3/ip_address_management/api_list_ip.go new file mode 100644 index 00000000..252b5f80 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_list_ip.go @@ -0,0 +1,184 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListIpParam struct { + // Specifies an IP address. The `ip` query parameter can be used to filter results by IP address. + Ip *string `json:"ip,omitempty"` + // Specifies the number of results to be returned by the API. This parameter can be used in combination with the `before_key` or `after_key` parameters to iterate through paginated results. + Limit *int32 `json:"limit,omitempty"` + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. + AfterKey *int32 `json:"after_key,omitempty"` + // Specifies which items to be returned by the API. When the `before_key` is specified, the API will return items beginning from the first item before the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. + BeforeKey *string `json:"before_key,omitempty"` + // Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. + IsLeased *bool `json:"is_leased,omitempty"` + // Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. + IsEnabled *bool `json:"is_enabled,omitempty"` + // A parent must be assigned to an IP address before the parent can send mail from the IP and before the address can be assigned to an IP pool. Set this parameter value to true to allow the parent to send mail from the IP and make the IP eligible for IP pool assignment using the IP pool endpoints. + IsParentAssigned *bool `json:"is_parent_assigned,omitempty"` + // Specifies the unique ID for an IP Pool. When included, only IP addresses belonging to the specified Pool will be returned. + Pool *string `json:"pool,omitempty"` + // The `start_added_at` and `end_added_at` parameters are used to set a time window. IP addresses that were added to your account in the specified time window will be returned. The `start_added_at` parameter sets the beginning of the time window. + StartAddedAt *int32 `json:"start_added_at,omitempty"` + // The `start_added_at` and `end_added_at` parameters are used to set a time window. IP addresses that were added to your account in the specified time window will be returned. The `end_added_at` parameter sets the end of the time window. + EndAddedAt *int32 `json:"end_added_at,omitempty"` + // Allowed values are `all`, `eu`, and `us`. If you provide a specific region, results will include all pools that have at least one IP in the filtered region. If `all`, pools with at least one IP (regardless of region) will be returned. If the `region` filter is not provided, the query returns all pools, including empty ones. + Region *Region7 `json:"region,omitempty"` + // Boolean indicating whether or not to return the IP Pool's region information in the response. + IncludeRegion *bool `json:"include_region,omitempty"` +} + +func (params *ListIpParam) SetIp(Ip string) *ListIpParam { + params.Ip = &Ip + return params +} +func (params *ListIpParam) SetLimit(Limit int32) *ListIpParam { + params.Limit = &Limit + return params +} +func (params *ListIpParam) SetAfterKey(AfterKey int32) *ListIpParam { + params.AfterKey = &AfterKey + return params +} +func (params *ListIpParam) SetBeforeKey(BeforeKey string) *ListIpParam { + params.BeforeKey = &BeforeKey + return params +} +func (params *ListIpParam) SetIsLeased(IsLeased bool) *ListIpParam { + params.IsLeased = &IsLeased + return params +} +func (params *ListIpParam) SetIsEnabled(IsEnabled bool) *ListIpParam { + params.IsEnabled = &IsEnabled + return params +} +func (params *ListIpParam) SetIsParentAssigned(IsParentAssigned bool) *ListIpParam { + params.IsParentAssigned = &IsParentAssigned + return params +} +func (params *ListIpParam) SetPool(Pool string) *ListIpParam { + params.Pool = &Pool + return params +} +func (params *ListIpParam) SetStartAddedAt(StartAddedAt int32) *ListIpParam { + params.StartAddedAt = &StartAddedAt + return params +} +func (params *ListIpParam) SetEndAddedAt(EndAddedAt int32) *ListIpParam { + params.EndAddedAt = &EndAddedAt + return params +} +func (params *ListIpParam) SetRegion(Region Region7) *ListIpParam { + params.Region = &Region + return params +} +func (params *ListIpParam) SetIncludeRegion(IncludeRegion bool) *ListIpParam { + params.IncludeRegion = &IncludeRegion + return params +} + +// This operation returns a list of all IP addresses associated with your account. A sample of IP details is returned with each IP, including which Pools the IP is associated with, whether the IP is set to warm up automatically, and when the IP was last updated. ### Limitations The `is_parent_assigned` parameter and `pool` parameter cannot be used at the same time. By definition, an IP cannot be assigned to a Pool if it is not first enabled. You can use either the `before_key` or `after_key` in combination with the `limit` parameter to iterate through paginated results but not both. +func (c *ApiService) ListIp(params *ListIpParam) (interface{}, error) { + path := "/v3/send_ips/ips" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ip != nil { + data.Set("ip", *params.Ip) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.AfterKey != nil { + data.Set("after_key", fmt.Sprint(*params.AfterKey)) + } + if params != nil && params.BeforeKey != nil { + data.Set("before_key", *params.BeforeKey) + } + if params != nil && params.IsLeased != nil { + data.Set("is_leased", fmt.Sprint(*params.IsLeased)) + } + if params != nil && params.IsEnabled != nil { + data.Set("is_enabled", fmt.Sprint(*params.IsEnabled)) + } + if params != nil && params.IsParentAssigned != nil { + data.Set("is_parent_assigned", fmt.Sprint(*params.IsParentAssigned)) + } + if params != nil && params.Pool != nil { + data.Set("pool", *params.Pool) + } + if params != nil && params.StartAddedAt != nil { + data.Set("start_added_at", fmt.Sprint(*params.StartAddedAt)) + } + if params != nil && params.EndAddedAt != nil { + data.Set("end_added_at", fmt.Sprint(*params.EndAddedAt)) + } + if params != nil && params.Region != nil { + data.Set("region", fmt.Sprint(*params.Region)) + } + if params != nil && params.IncludeRegion != nil { + data.Set("include_region", fmt.Sprint(*params.IncludeRegion)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListIp200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_list_ip_assigned_to_ip_pool.go b/rest/api/v3/ip_address_management/api_list_ip_assigned_to_ip_pool.go new file mode 100644 index 00000000..243f5a8f --- /dev/null +++ b/rest/api/v3/ip_address_management/api_list_ip_assigned_to_ip_pool.go @@ -0,0 +1,103 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListIpAssignedToIpPoolParam struct { + // Specifies the number of results to be returned by the API. This parameter can be used in combination with the `before_key` or `after_key` parameters to iterate through paginated results. + Limit *int32 `json:"limit,omitempty"` + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. + AfterKey *int32 `json:"after_key,omitempty"` + // Boolean indicating whether or not to return the IP Pool's region information in the response. + IncludeRegion *bool `json:"include_region,omitempty"` +} + +func (params *ListIpAssignedToIpPoolParam) SetLimit(Limit int32) *ListIpAssignedToIpPoolParam { + params.Limit = &Limit + return params +} +func (params *ListIpAssignedToIpPoolParam) SetAfterKey(AfterKey int32) *ListIpAssignedToIpPoolParam { + params.AfterKey = &AfterKey + return params +} +func (params *ListIpAssignedToIpPoolParam) SetIncludeRegion(IncludeRegion bool) *ListIpAssignedToIpPoolParam { + params.IncludeRegion = &IncludeRegion + return params +} + +// This operation returns the IP addresses that are assigned to the specified IP pool. +func (c *ApiService) ListIpAssignedToIpPool(params *ListIpAssignedToIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools/{Poolid}/ips" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.AfterKey != nil { + data.Set("after_key", fmt.Sprint(*params.AfterKey)) + } + if params != nil && params.IncludeRegion != nil { + data.Set("include_region", fmt.Sprint(*params.IncludeRegion)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListIpAssignedToIpPool200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_list_ip_pool.go b/rest/api/v3/ip_address_management/api_list_ip_pool.go new file mode 100644 index 00000000..25f87117 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_list_ip_pool.go @@ -0,0 +1,121 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListIpPoolParam struct { + // Specifies the number of results to be returned by the API. This parameter can be used in combination with the `before_key` or `after_key` parameters to iterate through paginated results. + Limit *int32 `json:"limit,omitempty"` + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. + AfterKey *int32 `json:"after_key,omitempty"` + // Specifies an IP address. The `ip` query parameter can be used to filter results by IP address. + Ip *string `json:"ip,omitempty"` + // Allowed values are `all`, `eu`, and `us`. If you provide a specific region, results will include all pools that have at least one IP in the filtered region. If `all`, pools with at least one IP (regardless of region) will be returned. If the `region` filter is not provided, the query returns all pools, including empty ones. + Region *Region7 `json:"region,omitempty"` + // Boolean indicating whether or not to return the IP Pool's region information in the response. + IncludeRegion *bool `json:"include_region,omitempty"` +} + +func (params *ListIpPoolParam) SetLimit(Limit int32) *ListIpPoolParam { + params.Limit = &Limit + return params +} +func (params *ListIpPoolParam) SetAfterKey(AfterKey int32) *ListIpPoolParam { + params.AfterKey = &AfterKey + return params +} +func (params *ListIpPoolParam) SetIp(Ip string) *ListIpPoolParam { + params.Ip = &Ip + return params +} +func (params *ListIpPoolParam) SetRegion(Region Region7) *ListIpPoolParam { + params.Region = &Region + return params +} +func (params *ListIpPoolParam) SetIncludeRegion(IncludeRegion bool) *ListIpPoolParam { + params.IncludeRegion = &IncludeRegion + return params +} + +// This operation returns a list of your IP Pools and a sample of each Pools' associated IP addresses. A maximum of 10 IPs will be returned per IP Pool by default. To retrieve additional IP addresses associated with a Pool, use the \"Get IPs Assigned to an IP Pool\" operation. Each user may have a maximum of 100 IP Pools. +func (c *ApiService) ListIpPool(params *ListIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.AfterKey != nil { + data.Set("after_key", fmt.Sprint(*params.AfterKey)) + } + if params != nil && params.Ip != nil { + data.Set("ip", *params.Ip) + } + if params != nil && params.Region != nil { + data.Set("region", fmt.Sprint(*params.Region)) + } + if params != nil && params.IncludeRegion != nil { + data.Set("include_region", fmt.Sprint(*params.IncludeRegion)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListIpPool200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_list_sub_user_assigned_to_ip.go b/rest/api/v3/ip_address_management/api_list_sub_user_assigned_to_ip.go new file mode 100644 index 00000000..b185c82c --- /dev/null +++ b/rest/api/v3/ip_address_management/api_list_sub_user_assigned_to_ip.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListSubUserAssignedToIpParam struct { + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. + AfterKey *int32 `json:"after_key,omitempty"` + // Specifies the number of results to be returned by the API. This parameter can be used in combination with the `after_key` parameters to iterate through paginated results. The maximum limit is 100. + Limit *int32 `json:"limit,omitempty"` +} + +func (params *ListSubUserAssignedToIpParam) SetAfterKey(AfterKey int32) *ListSubUserAssignedToIpParam { + params.AfterKey = &AfterKey + return params +} +func (params *ListSubUserAssignedToIpParam) SetLimit(Limit int32) *ListSubUserAssignedToIpParam { + params.Limit = &Limit + return params +} + +// This operation returns a list of Subuser IDs that have been assigned the specified IP address. To retrieve more information about the returned Subusers, use the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/list-all-subusers). You can use the `after_key` and `limit` query parameters to iterate through paginated results. The maximum limit is 100, meaning you may retrieve up to 100 Subusers per request. If the `after_key` in the API response is not null, there are more Subusers assigned to the IP address than those returned in the request. You can repeat the request with the non-null `after_key` value and the same limit to retrieve the next group of Subusers. +func (c *ApiService) ListSubUserAssignedToIp(params *ListSubUserAssignedToIpParam) (interface{}, error) { + path := "/v3/send_ips/ips/{Ip}/subusers" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.AfterKey != nil { + data.Set("after_key", fmt.Sprint(*params.AfterKey)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListSubUserAssignedToIp200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_service.go b/rest/api/v3/ip_address_management/api_service.go new file mode 100644 index 00000000..b08b7968 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/ip_address_management/api_update_ip.go b/rest/api/v3/ip_address_management/api_update_ip.go new file mode 100644 index 00000000..cc6d1c65 --- /dev/null +++ b/rest/api/v3/ip_address_management/api_update_ip.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateIpParam struct { + // The `ip` path parameter specifies an IP address to make the request against. + Ip *string `json:"ip"` + // + UpdateIpRequest *UpdateIpRequest `json:"UpdateIpRequest,omitempty"` +} + +func (params *UpdateIpParam) SetIp(Ip string) *UpdateIpParam { + params.Ip = &Ip + return params +} +func (params *UpdateIpParam) SetUpdateIpRequest(UpdateIpRequest UpdateIpRequest) *UpdateIpParam { + params.UpdateIpRequest = &UpdateIpRequest + return params +} + +// This operation updates an IP address's settings, including whether the IP is set to warm up automatically, if the IP is assigned by a parent account, and whether the IP is enabled or disabled. The request body must include at least one of the `is_auto_warmup`, `is_parent_assigned`, or `is_enabled` fields. +func (c *ApiService) UpdateIp(params *UpdateIpParam) (interface{}, error) { + path := "/v3/send_ips/ips/{Ip}" + if params != nil && params.Ip != nil { + path = strings.Replace(path, "{"+"Ip"+"}", *params.Ip, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateIpRequest != nil { + b, err := json.Marshal(*params.UpdateIpRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateIp200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/api_update_ip_pool.go b/rest/api/v3/ip_address_management/api_update_ip_pool.go new file mode 100644 index 00000000..37f9a59d --- /dev/null +++ b/rest/api/v3/ip_address_management/api_update_ip_pool.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateIpPoolParam struct { + // Specifies the unique ID for an IP Pool. + Poolid *string `json:"poolid"` + // + UpdateIpPoolRequest *UpdateIpPoolRequest `json:"UpdateIpPoolRequest,omitempty"` +} + +func (params *UpdateIpPoolParam) SetPoolid(Poolid string) *UpdateIpPoolParam { + params.Poolid = &Poolid + return params +} +func (params *UpdateIpPoolParam) SetUpdateIpPoolRequest(UpdateIpPoolRequest UpdateIpPoolRequest) *UpdateIpPoolParam { + params.UpdateIpPoolRequest = &UpdateIpPoolRequest + return params +} + +// This operation will rename an IP Pool. An IP Pool name cannot start with a dot/period (.) or space. +func (c *ApiService) UpdateIpPool(params *UpdateIpPoolParam) (interface{}, error) { + path := "/v3/send_ips/pools/{Poolid}" + if params != nil && params.Poolid != nil { + path = strings.Replace(path, "{"+"Poolid"+"}", *params.Poolid, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateIpPoolRequest != nil { + b, err := json.Marshal(*params.UpdateIpPoolRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateIpPool200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &IpAddressManagementErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_address_management/docs/AddIp.md b/rest/api/v3/ip_address_management/docs/AddIp.md new file mode 100644 index 00000000..9a9abe96 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddIp.md @@ -0,0 +1,48 @@ +# AddIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddIp**](AddIp.md#AddIp) | **Post** /v3/send_ips/ips | Add a Twilio SendGrid IP Address + + + +## AddIp + +> AddIp201Response AddIp(ctx, optional) + +Add a Twilio SendGrid IP Address + +This operation adds a Twilio SendGrid IP address to your account. You can also assign up to 100 Subusers to the IP address at creation. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a AddIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AddIpRequest** | [**AddIpRequest**](AddIpRequest.md) | + +### Return type + +[**AddIp201Response**](AddIp201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/AddIp201Response.md b/rest/api/v3/ip_address_management/docs/AddIp201Response.md new file mode 100644 index 00000000..dd163214 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddIp201Response.md @@ -0,0 +1,15 @@ +# AddIp201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address that was added to your account. |[optional] +**IsAutoWarmup** | **bool** | Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). This parameter is returned only if the IP address is set to automatically warm up. |[optional] +**IsParentAssigned** | **bool** | Indicates if a parent on the account is able to send email from the IP address. |[optional] +**Subusers** | **[]string** | An array of Subuser IDs the IP address was assigned to. |[optional] +**Region** | [**Region2**](Region2.md) | The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/AddIpRequest.md b/rest/api/v3/ip_address_management/docs/AddIpRequest.md new file mode 100644 index 00000000..55d0e7b0 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddIpRequest.md @@ -0,0 +1,15 @@ +# AddIpRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsAutoWarmup** | **bool** | Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). | +**IsParentAssigned** | **bool** | Indicates if a parent on the account is able to send email from the IP address. | +**Subusers** | **[]string** | An array of Subuser IDs the IP address will be assigned to. |[optional] +**Region** | [**Region3**](Region3.md) | The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] +**IncludeRegion** | **bool** | Boolean indicating whether or not to return the IP address's region information in the response. |[optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/AddIpsToIpPool.md b/rest/api/v3/ip_address_management/docs/AddIpsToIpPool.md new file mode 100644 index 00000000..a04565b8 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddIpsToIpPool.md @@ -0,0 +1,52 @@ +# AddIpsToIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddIpsToIpPool**](AddIpsToIpPool.md#AddIpsToIpPool) | **Post** /v3/send_ips/pools/{Poolid}/ips:batchAdd | Add a Batch of IPs to an IP Pool + + + +## AddIpsToIpPool + +> AddIpsToIpPool200Response AddIpsToIpPool(ctx, Poolidoptional) + +Add a Batch of IPs to an IP Pool + +This operation appends a batch of IPs to an IP Pool. This operation requires all IP assignments to succeed. If any IP assignments fail, this endpoint will return an error. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Poolid** | **string** | Specifies the unique ID for an IP Pool. + +### Other Parameters + +Other parameters are passed through a pointer to a AddIpsToIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AddIpsToIpPoolRequest** | [**AddIpsToIpPoolRequest**](AddIpsToIpPoolRequest.md) | + +### Return type + +[**AddIpsToIpPool200Response**](AddIpsToIpPool200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/AddIpsToIpPool200Response.md b/rest/api/v3/ip_address_management/docs/AddIpsToIpPool200Response.md new file mode 100644 index 00000000..b7c91aa0 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddIpsToIpPool200Response.md @@ -0,0 +1,13 @@ +# AddIpsToIpPool200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the IP Pool. |[optional] +**Id** | **string** | The unique ID of the IP Pool. |[optional] +**Ips** | **[]string** | An array of IP addresses assigned to the IP Pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/AddIpsToIpPoolRequest.md b/rest/api/v3/ip_address_management/docs/AddIpsToIpPoolRequest.md new file mode 100644 index 00000000..179f44fa --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddIpsToIpPoolRequest.md @@ -0,0 +1,11 @@ +# AddIpsToIpPoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ips** | **[]string** | An array of IP addresses to assign to the specified IP Pool. All assignments must succeed. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/AddSubUsersToIp.md b/rest/api/v3/ip_address_management/docs/AddSubUsersToIp.md new file mode 100644 index 00000000..bfbe9f17 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddSubUsersToIp.md @@ -0,0 +1,52 @@ +# AddSubUsersToIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddSubUsersToIp**](AddSubUsersToIp.md#AddSubUsersToIp) | **Post** /v3/send_ips/ips/{Ip}/subusers:batchAdd | Assign a Batch of Subusers to an IP + + + +## AddSubUsersToIp + +> AddSubUsersToIp200Response AddSubUsersToIp(ctx, Ipoptional) + +Assign a Batch of Subusers to an IP + +This operation appends a batch of Subusers to a specified IP address. This endpoint requires all Subuser assignments to succeed. If a Subuser assignment fails, this endpoint will return an error. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Ip** | **string** | The `ip` path parameter specifies an IP address to make the request against. + +### Other Parameters + +Other parameters are passed through a pointer to a AddSubUsersToIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AddSubUsersToIpRequest** | [**AddSubUsersToIpRequest**](AddSubUsersToIpRequest.md) | + +### Return type + +[**AddSubUsersToIp200Response**](AddSubUsersToIp200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/AddSubUsersToIp200Response.md b/rest/api/v3/ip_address_management/docs/AddSubUsersToIp200Response.md new file mode 100644 index 00000000..735f87af --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddSubUsersToIp200Response.md @@ -0,0 +1,12 @@ +# AddSubUsersToIp200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address the Subusers were assigned to. |[optional] +**Subusers** | **[]string** | An array of Subuser IDs that were assigned to the specified IP address. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/AddSubUsersToIpRequest.md b/rest/api/v3/ip_address_management/docs/AddSubUsersToIpRequest.md new file mode 100644 index 00000000..cdfb8a0d --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/AddSubUsersToIpRequest.md @@ -0,0 +1,11 @@ +# AddSubUsersToIpRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subusers** | **[]string** | An array of Subuser IDs to be assigned to the specified IP address. All Subuser assignments must succeed. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/CreateIpPool.md b/rest/api/v3/ip_address_management/docs/CreateIpPool.md new file mode 100644 index 00000000..a047e28f --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/CreateIpPool.md @@ -0,0 +1,48 @@ +# CreateIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateIpPool**](CreateIpPool.md#CreateIpPool) | **Post** /v3/send_ips/pools | Create an IP Pool with a Name and IP Assignments + + + +## CreateIpPool + +> CreateIpPool201Response CreateIpPool(ctx, optional) + +Create an IP Pool with a Name and IP Assignments + +This operation will create a named IP Pool and associate specified IP addresses with the newly created Pool. This operation requires all IP assignments to succeed. If any IP assignments fail, this endpoint will return an error and the Pool will not be created. Each IP Pool may have a maximum of 100 assigned IP addresses. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**CreateIpPoolRequest** | [**CreateIpPoolRequest**](CreateIpPoolRequest.md) | + +### Return type + +[**CreateIpPool201Response**](CreateIpPool201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/CreateIpPool201Response.md b/rest/api/v3/ip_address_management/docs/CreateIpPool201Response.md new file mode 100644 index 00000000..0e1723bd --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/CreateIpPool201Response.md @@ -0,0 +1,13 @@ +# CreateIpPool201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name assigned to the IP Pool. |[optional] +**Id** | **string** | The unique ID of the IP Pool. |[optional] +**Ips** | **[]string** | An array of IP addresses assigned to the IP Pool. All assignments must succeed. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/CreateIpPoolRequest.md b/rest/api/v3/ip_address_management/docs/CreateIpPoolRequest.md new file mode 100644 index 00000000..77aa2295 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/CreateIpPoolRequest.md @@ -0,0 +1,12 @@ +# CreateIpPoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name to assign to the IP Pool. An IP Pool name cannot begin with a space or period. | +**Ips** | **[]string** | An array of IP addresses to assign to the IP Pool. All assignments must succeed. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/DeleteIpPool.md b/rest/api/v3/ip_address_management/docs/DeleteIpPool.md new file mode 100644 index 00000000..ddfe136d --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/DeleteIpPool.md @@ -0,0 +1,51 @@ +# DeleteIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteIpPool**](DeleteIpPool.md#DeleteIpPool) | **Delete** /v3/send_ips/pools/{Poolid} | Delete IP Pool + + + +## DeleteIpPool + +> DeleteIpPool(ctx, Poolid) + +Delete IP Pool + +This operation deletes an IP Pool and unassigns all IP addresses associated with the Pool. IP addresses associated with the deleted Pool will remain in your account. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Poolid** | **string** | Specifies the unique ID for an IP Pool. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPool.md b/rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPool.md new file mode 100644 index 00000000..0d7f751b --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPool.md @@ -0,0 +1,52 @@ +# DeleteIpsFromIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteIpsFromIpPool**](DeleteIpsFromIpPool.md#DeleteIpsFromIpPool) | **Post** /v3/send_ips/pools/{Poolid}/ips:batchDelete | Delete a Batch of IPs from an IP Pool + + + +## DeleteIpsFromIpPool + +> DeleteIpsFromIpPool(ctx, Poolidoptional) + +Delete a Batch of IPs from an IP Pool + +This operation removes a batch of IPs from an IP Pool. All IPs associated with the Pool will be unassigned from the deleted Pool. However, this operation does not remove the IPs from your account. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Poolid** | **string** | Specifies the unique ID for an IP Pool. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteIpsFromIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DeleteIpsFromIpPoolRequest** | [**DeleteIpsFromIpPoolRequest**](DeleteIpsFromIpPoolRequest.md) | + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPoolRequest.md b/rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPoolRequest.md new file mode 100644 index 00000000..61bb0a31 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/DeleteIpsFromIpPoolRequest.md @@ -0,0 +1,11 @@ +# DeleteIpsFromIpPoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ips** | **[]string** | An array of IP addresses to remove from the specified IP Pool. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIp.md b/rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIp.md new file mode 100644 index 00000000..811d1638 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIp.md @@ -0,0 +1,52 @@ +# DeleteSubUsersFromIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSubUsersFromIp**](DeleteSubUsersFromIp.md#DeleteSubUsersFromIp) | **Post** /v3/send_ips/ips/{Ip}/subusers:batchDelete | Delete a Batch of Subusers from an IP + + + +## DeleteSubUsersFromIp + +> DeleteSubUsersFromIp(ctx, Ipoptional) + +Delete a Batch of Subusers from an IP + +This operation removes a batch of Subusers from a specified IP address. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Ip** | **string** | The `ip` path parameter specifies an IP address to make the request against. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSubUsersFromIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DeleteSubUsersFromIpRequest** | [**DeleteSubUsersFromIpRequest**](DeleteSubUsersFromIpRequest.md) | + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIpRequest.md b/rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIpRequest.md new file mode 100644 index 00000000..f8017d53 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/DeleteSubUsersFromIpRequest.md @@ -0,0 +1,11 @@ +# DeleteSubUsersFromIpRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subusers** | **[]string** | An array of Subuser IDs to be removed from the specified IP address. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/GetIp.md b/rest/api/v3/ip_address_management/docs/GetIp.md new file mode 100644 index 00000000..e911a0d5 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/GetIp.md @@ -0,0 +1,48 @@ +# GetIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetIp**](GetIp.md#GetIp) | **Get** /v3/send_ips/ips/{Ip} | Get Details for an IP Address + + + +## GetIp + +> GetIp200Response GetIp(ctx, optional) + +Get Details for an IP Address + +This operation returns details for a specified IP address. Details include whether the IP is assigned to a parent account, set to warm up automatically, which Pools the IP is associated with, when the IP was added and modified, whether the IP is leased, and whether the IP is enabled. Note that this operation will not return Subuser information associated with the IP. To retrieve Subuser information, use the \"Get a List of Subusers Assigned to an IP\" endpoint. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a GetIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**IncludeRegion** | **bool** | Boolean indicating whether or not to return the IP Pool's region information in the response. + +### Return type + +[**GetIp200Response**](GetIp200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/GetIp200Response.md b/rest/api/v3/ip_address_management/docs/GetIp200Response.md new file mode 100644 index 00000000..92877de3 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/GetIp200Response.md @@ -0,0 +1,19 @@ +# GetIp200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address specified in the request. |[optional] +**IsParentAssigned** | **bool** | Indicates if a parent on the account is able to send email from the IP address. |[optional] +**IsAutoWarmup** | **bool** | Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). |[optional] +**Pools** | [**[]GetIp200ResponsePoolsInner**](GetIp200ResponsePoolsInner.md) | An array of IP Pools the IP address is assigned to. |[optional] +**AddedAt** | **int32** | A timestamp indicating when the IP address was added to your account. |[optional] +**UpdatedAt** | Pointer to **int32** | A timestamp indicating when the IP was last updated. | +**IsEnabled** | Pointer to **bool** | Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. | +**IsLeased** | **bool** | Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. |[optional] +**Region** | **string** | The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. Possible values are `us` or `eu`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/GetIp200ResponsePoolsInner.md b/rest/api/v3/ip_address_management/docs/GetIp200ResponsePoolsInner.md new file mode 100644 index 00000000..4dff4853 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/GetIp200ResponsePoolsInner.md @@ -0,0 +1,12 @@ +# GetIp200ResponsePoolsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of the IP Pool. |[optional] +**Name** | **string** | The name of the IP Pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/GetIpPool.md b/rest/api/v3/ip_address_management/docs/GetIpPool.md new file mode 100644 index 00000000..efbc6181 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/GetIpPool.md @@ -0,0 +1,48 @@ +# GetIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetIpPool**](GetIpPool.md#GetIpPool) | **Get** /v3/send_ips/pools/{Poolid} | Get Details for an IP Pool + + + +## GetIpPool + +> GetIpPool200Response GetIpPool(ctx, optional) + +Get Details for an IP Pool + +This operation will return the details for a specified IP Pool, including the Pool's name, ID, a sample list of the IPs associated with the Pool, and the total number of IPs belonging to the Pool. A maximum of 10 IPs will be returned per IP Pool by default. To retrieve additional IP addresses associated with a Pool, use the \"Get IPs Assigned to an IP Pool\" operation. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a GetIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**IncludeRegion** | **bool** | Boolean indicating whether or not to return the IP Pool's region information in the response. + +### Return type + +[**GetIpPool200Response**](GetIpPool200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/GetIpPool200Response.md b/rest/api/v3/ip_address_management/docs/GetIpPool200Response.md new file mode 100644 index 00000000..38fffdf5 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/GetIpPool200Response.md @@ -0,0 +1,15 @@ +# GetIpPool200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the IP Pool. |[optional] +**Id** | **string** | The unique ID of the IP Pool. |[optional] +**IpsPreview** | **[]string** | A sample list of IP addresses associated with the IP Pool. The sample is limited to 10 results. |[optional] +**TotalIpCount** | **int32** | The total number of IP addresses in the IP Pool. An IP Pool can have a maximum of 100 associated IP addresses. |[optional] +**IpCountByRegion** | [**[]GetIpPool200ResponseIpCountByRegionInner**](GetIpPool200ResponseIpCountByRegionInner.md) | The total number of IP addresses by region. this object is only returned if the `include_region` parameter is included and set to `true` in the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/GetIpPool200ResponseIpCountByRegionInner.md b/rest/api/v3/ip_address_management/docs/GetIpPool200ResponseIpCountByRegionInner.md new file mode 100644 index 00000000..287c899e --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/GetIpPool200ResponseIpCountByRegionInner.md @@ -0,0 +1,12 @@ +# GetIpPool200ResponseIpCountByRegionInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Region** | [**Region5**](Region5.md) | The region associated with the number of IPs listed in the `count` property. |[optional] +**Count** | **int32** | The number of IP addresses in the pool that are assigned to the region specified in the `region` property for this count. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponse.md b/rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponse.md new file mode 100644 index 00000000..dcf00eaf --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponse.md @@ -0,0 +1,11 @@ +# IpAddressManagementErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]IpAddressManagementErrorResponseErrorsInner**](IpAddressManagementErrorResponseErrorsInner.md) | An array of error objects. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponseErrorsInner.md b/rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponseErrorsInner.md new file mode 100644 index 00000000..ce08001a --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/IpAddressManagementErrorResponseErrorsInner.md @@ -0,0 +1,12 @@ +# IpAddressManagementErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | Indicates which field caused the error. This may be an empty string if no specific field is responsible for the error. |[optional] +**Message** | **string** | An error-specific message that provides more information about the error's cause. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Items.md b/rest/api/v3/ip_address_management/docs/Items.md new file mode 100644 index 00000000..fb3e88bd --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Items.md @@ -0,0 +1,13 @@ +# Items + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"eu"`) +**US** | string | (value: `"us"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIp.md b/rest/api/v3/ip_address_management/docs/ListIp.md new file mode 100644 index 00000000..4386ce78 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIp.md @@ -0,0 +1,59 @@ +# ListIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListIp**](ListIp.md#ListIp) | **Get** /v3/send_ips/ips | Get a List of all IP Addresses on your Account + + + +## ListIp + +> ListIp200Response ListIp(ctx, optional) + +Get a List of all IP Addresses on your Account + +This operation returns a list of all IP addresses associated with your account. A sample of IP details is returned with each IP, including which Pools the IP is associated with, whether the IP is set to warm up automatically, and when the IP was last updated. ### Limitations The `is_parent_assigned` parameter and `pool` parameter cannot be used at the same time. By definition, an IP cannot be assigned to a Pool if it is not first enabled. You can use either the `before_key` or `after_key` in combination with the `limit` parameter to iterate through paginated results but not both. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Ip** | **string** | Specifies an IP address. The `ip` query parameter can be used to filter results by IP address. +**Limit** | **int32** | Specifies the number of results to be returned by the API. This parameter can be used in combination with the `before_key` or `after_key` parameters to iterate through paginated results. +**AfterKey** | **int32** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. +**BeforeKey** | **string** | Specifies which items to be returned by the API. When the `before_key` is specified, the API will return items beginning from the first item before the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. +**IsLeased** | **bool** | Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. +**IsEnabled** | **bool** | Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. +**IsParentAssigned** | **bool** | A parent must be assigned to an IP address before the parent can send mail from the IP and before the address can be assigned to an IP pool. Set this parameter value to true to allow the parent to send mail from the IP and make the IP eligible for IP pool assignment using the IP pool endpoints. +**Pool** | **string** | Specifies the unique ID for an IP Pool. When included, only IP addresses belonging to the specified Pool will be returned. +**StartAddedAt** | **int32** | The `start_added_at` and `end_added_at` parameters are used to set a time window. IP addresses that were added to your account in the specified time window will be returned. The `start_added_at` parameter sets the beginning of the time window. +**EndAddedAt** | **int32** | The `start_added_at` and `end_added_at` parameters are used to set a time window. IP addresses that were added to your account in the specified time window will be returned. The `end_added_at` parameter sets the end of the time window. +**Region** | [**Region7**](Region7Region7.md) | Allowed values are `all`, `eu`, and `us`. If you provide a specific region, results will include all pools that have at least one IP in the filtered region. If `all`, pools with at least one IP (regardless of region) will be returned. If the `region` filter is not provided, the query returns all pools, including empty ones. +**IncludeRegion** | **bool** | Boolean indicating whether or not to return the IP Pool's region information in the response. + +### Return type + +[**ListIp200Response**](ListIp200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/ListIp200Response.md b/rest/api/v3/ip_address_management/docs/ListIp200Response.md new file mode 100644 index 00000000..d4e0057c --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIp200Response.md @@ -0,0 +1,12 @@ +# ListIp200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListIp200ResponseResultInner**](ListIp200ResponseResultInner.md) | |[optional] +**Metadata** | [**ListIp200ResponseMetadata**](ListIp200ResponseMetadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadata.md b/rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadata.md new file mode 100644 index 00000000..025e9096 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadata.md @@ -0,0 +1,11 @@ +# ListIp200ResponseMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextParams** | [**ListIp200ResponseMetadataNextParams**](ListIp200ResponseMetadataNextParams.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadataNextParams.md b/rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadataNextParams.md new file mode 100644 index 00000000..5b3f6867 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIp200ResponseMetadataNextParams.md @@ -0,0 +1,22 @@ +# ListIp200ResponseMetadataNextParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AfterKey** | Pointer to **string** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. | +**BeforeKey** | Pointer to **string** | Specifies which items to be returned by the API. When the `before_key` is specified, the API will return items beginning from the first item before the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `before_key` cannot be used in combination with the `after_key` parameter. | +**Ip** | **string** | The IP address specified in the request with the `ip` query parameter. This parameter is returned only when an IP is included in the request. |[optional] +**IsLeased** | **bool** | Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. This parameter is returned only if the IP address is leased. |[optional] +**IsEnabled** | **bool** | Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. This parameter is returned only if the IP address is enabled. |[optional] +**IsParentAssigned** | **bool** | Indicates if a parent on the account is able to send email from the IP address. This parameter is returned only if the IP address is parent assigned. |[optional] +**Pool** | **string** | The IP Pool ID specified in the request with the `pool` query parameter. This parameter is returned only when an IP Pool is included in the request. |[optional] +**StartAddedAt** | **string** | The beginning of the time window specified in the request with the `start_added_at` query parameter. This parameter is returned only when the `start_added_at` parameter is included in the request. |[optional] +**EndAddedAt** | **string** | The end of the time window specified in the request with the `end_added_at` query parameter. This parameter is returned only when the `end_added_at` parameter is included in the request. |[optional] +**Limit** | **string** | The number of items returned in the request. This parameter is returned only when a `limit` is set using the `limit` query parameter in the request. |[optional] +**Region** | [**Region1**](Region1.md) | The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request, |[optional] +**IncludeRegion** | **string** | Indicates whether or not to include the IP address's region. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInner.md b/rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInner.md new file mode 100644 index 00000000..f5afc216 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInner.md @@ -0,0 +1,19 @@ +# ListIp200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | An IP address on your account. |[optional] +**Pools** | [**[]ListIp200ResponseResultInnerPoolsInner**](ListIp200ResponseResultInnerPoolsInner.md) | An array of IP Pools the IP address is assigned to. |[optional] +**IsAutoWarmup** | **bool** | Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). |[optional] +**IsParentAssigned** | Pointer to **bool** | Indicates if a parent on the account is able to send email from the IP address. This parameter will be returned only if the request was made by the parent account. | +**UpdatedAt** | Pointer to **int32** | A timestamp indicating when the IP was last updated. | +**IsEnabled** | Pointer to **bool** | Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. | +**IsLeased** | **bool** | Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. |[optional] +**AddedAt** | **int32** | A timestamp representing when the IP address was added to your account. |[optional] +**Region** | [**Region**](Region.md) | The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInnerPoolsInner.md b/rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInnerPoolsInner.md new file mode 100644 index 00000000..2457686e --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIp200ResponseResultInnerPoolsInner.md @@ -0,0 +1,12 @@ +# ListIp200ResponseResultInnerPoolsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the IP Pool. |[optional] +**Id** | **string** | The unique ID of the IP Pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool.md b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool.md new file mode 100644 index 00000000..27120fb3 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool.md @@ -0,0 +1,50 @@ +# ListIpAssignedToIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListIpAssignedToIpPool**](ListIpAssignedToIpPool.md#ListIpAssignedToIpPool) | **Get** /v3/send_ips/pools/{Poolid}/ips | Get IPs Assigned to an IP Pool + + + +## ListIpAssignedToIpPool + +> ListIpAssignedToIpPool200Response ListIpAssignedToIpPool(ctx, optional) + +Get IPs Assigned to an IP Pool + +This operation returns the IP addresses that are assigned to the specified IP pool. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListIpAssignedToIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | Specifies the number of results to be returned by the API. This parameter can be used in combination with the `before_key` or `after_key` parameters to iterate through paginated results. +**AfterKey** | **int32** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. +**IncludeRegion** | **bool** | Boolean indicating whether or not to return the IP Pool's region information in the response. + +### Return type + +[**ListIpAssignedToIpPool200Response**](ListIpAssignedToIpPool200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200Response.md b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200Response.md new file mode 100644 index 00000000..6bbf46ba --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200Response.md @@ -0,0 +1,12 @@ +# ListIpAssignedToIpPool200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListIpAssignedToIpPool200ResponseResultInner**](ListIpAssignedToIpPool200ResponseResultInner.md) | |[optional] +**Metadata** | [**ListIpAssignedToIpPool200ResponseMetadata**](ListIpAssignedToIpPool200ResponseMetadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadata.md b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadata.md new file mode 100644 index 00000000..f8890c12 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadata.md @@ -0,0 +1,11 @@ +# ListIpAssignedToIpPool200ResponseMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextParams** | [**ListIpAssignedToIpPool200ResponseMetadataNextParams**](ListIpAssignedToIpPool200ResponseMetadataNextParams.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadataNextParams.md b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadataNextParams.md new file mode 100644 index 00000000..1988a996 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseMetadataNextParams.md @@ -0,0 +1,13 @@ +# ListIpAssignedToIpPool200ResponseMetadataNextParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AfterKey** | Pointer to **string** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. | +**Limit** | **string** | The `limit` specified in the request. This parameter will be included only if it was specified in the request. This is not the default limit enforced by the API. |[optional] +**IncludeRegion** | **string** | Indicates whether or not to include the IP address's region. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseResultInner.md b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseResultInner.md new file mode 100644 index 00000000..d8ffe910 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpAssignedToIpPool200ResponseResultInner.md @@ -0,0 +1,13 @@ +# ListIpAssignedToIpPool200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | An IP address assigned to the IP Pool. |[optional] +**Region** | [**Region6**](Region6.md) | The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] +**Pools** | [**[]ListIp200ResponseResultInnerPoolsInner**](ListIp200ResponseResultInnerPoolsInner.md) | IP Pools the IP address is assigned to. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpPool.md b/rest/api/v3/ip_address_management/docs/ListIpPool.md new file mode 100644 index 00000000..e49c30f6 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpPool.md @@ -0,0 +1,52 @@ +# ListIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListIpPool**](ListIpPool.md#ListIpPool) | **Get** /v3/send_ips/pools | GET all IP Pools that have Associated IPs + + + +## ListIpPool + +> ListIpPool200Response ListIpPool(ctx, optional) + +GET all IP Pools that have Associated IPs + +This operation returns a list of your IP Pools and a sample of each Pools' associated IP addresses. A maximum of 10 IPs will be returned per IP Pool by default. To retrieve additional IP addresses associated with a Pool, use the \"Get IPs Assigned to an IP Pool\" operation. Each user may have a maximum of 100 IP Pools. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | Specifies the number of results to be returned by the API. This parameter can be used in combination with the `before_key` or `after_key` parameters to iterate through paginated results. +**AfterKey** | **int32** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. +**Ip** | **string** | Specifies an IP address. The `ip` query parameter can be used to filter results by IP address. +**Region** | [**Region7**](Region7Region7.md) | Allowed values are `all`, `eu`, and `us`. If you provide a specific region, results will include all pools that have at least one IP in the filtered region. If `all`, pools with at least one IP (regardless of region) will be returned. If the `region` filter is not provided, the query returns all pools, including empty ones. +**IncludeRegion** | **bool** | Boolean indicating whether or not to return the IP Pool's region information in the response. + +### Return type + +[**ListIpPool200Response**](ListIpPool200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/ListIpPool200Response.md b/rest/api/v3/ip_address_management/docs/ListIpPool200Response.md new file mode 100644 index 00000000..30b278aa --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpPool200Response.md @@ -0,0 +1,12 @@ +# ListIpPool200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListIpPool200ResponseResultInner**](ListIpPool200ResponseResultInner.md) | |[optional] +**Metadata** | [**ListIpPool200ResponseMetadata**](ListIpPool200ResponseMetadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadata.md b/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadata.md new file mode 100644 index 00000000..33136f18 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadata.md @@ -0,0 +1,11 @@ +# ListIpPool200ResponseMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextParams** | [**ListIpPool200ResponseMetadataNextParams**](ListIpPool200ResponseMetadataNextParams.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadataNextParams.md b/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadataNextParams.md new file mode 100644 index 00000000..b59951d5 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseMetadataNextParams.md @@ -0,0 +1,15 @@ +# ListIpPool200ResponseMetadataNextParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AfterKey** | Pointer to **string** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. | +**Ip** | **string** | The IP address specified in the request. This parameter will be returned only if it was specified in the request. |[optional] +**Limit** | **string** | The `limit` specified in the request. This parameter will be included only if it was specified in the request. This is not the default limit enforced by the API. |[optional] +**Region** | [**Region4**](Region4.md) | The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] +**IncludeRegion** | **string** | Indicates whether or not to include the IP address's region. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseResultInner.md b/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseResultInner.md new file mode 100644 index 00000000..f8b44a23 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListIpPool200ResponseResultInner.md @@ -0,0 +1,15 @@ +# ListIpPool200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the IP Pool. |[optional] +**Id** | **string** | The unique ID of the IP Pool. |[optional] +**Regions** | [**[]Items**](Items.md) | An array of the unique regions of all the IP addresses returned within the IP pool. |[optional] +**IpsPreview** | **[]string** | A sample list of IP addresses associated with the IP Pool. The sample is limited to 10 results. |[optional] +**TotalIpCount** | **int32** | The total number of IP addresses in the IP Pool. An IP Pool can have a maximum of 100 associated IP addresses. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp.md b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp.md new file mode 100644 index 00000000..e672cdd2 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp.md @@ -0,0 +1,49 @@ +# ListSubUserAssignedToIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSubUserAssignedToIp**](ListSubUserAssignedToIp.md#ListSubUserAssignedToIp) | **Get** /v3/send_ips/ips/{Ip}/subusers | Get a List of Subusers Assigned to an IP + + + +## ListSubUserAssignedToIp + +> ListSubUserAssignedToIp200Response ListSubUserAssignedToIp(ctx, optional) + +Get a List of Subusers Assigned to an IP + +This operation returns a list of Subuser IDs that have been assigned the specified IP address. To retrieve more information about the returned Subusers, use the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/list-all-subusers). You can use the `after_key` and `limit` query parameters to iterate through paginated results. The maximum limit is 100, meaning you may retrieve up to 100 Subusers per request. If the `after_key` in the API response is not null, there are more Subusers assigned to the IP address than those returned in the request. You can repeat the request with the non-null `after_key` value and the same limit to retrieve the next group of Subusers. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSubUserAssignedToIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AfterKey** | **int32** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. +**Limit** | **int32** | Specifies the number of results to be returned by the API. This parameter can be used in combination with the `after_key` parameters to iterate through paginated results. The maximum limit is 100. + +### Return type + +[**ListSubUserAssignedToIp200Response**](ListSubUserAssignedToIp200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200Response.md b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200Response.md new file mode 100644 index 00000000..df5554fb --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200Response.md @@ -0,0 +1,12 @@ +# ListSubUserAssignedToIp200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | **[]string** | An array of Subuser IDs that have been assigned the specified IP address. |[optional] +**Metadata** | [**ListSubUserAssignedToIp200ResponseMetadata**](ListSubUserAssignedToIp200ResponseMetadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadata.md b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadata.md new file mode 100644 index 00000000..05e6ef0a --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadata.md @@ -0,0 +1,11 @@ +# ListSubUserAssignedToIp200ResponseMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextParams** | [**ListSubUserAssignedToIp200ResponseMetadataNextParams**](ListSubUserAssignedToIp200ResponseMetadataNextParams.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadataNextParams.md b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadataNextParams.md new file mode 100644 index 00000000..36b362e5 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/ListSubUserAssignedToIp200ResponseMetadataNextParams.md @@ -0,0 +1,12 @@ +# ListSubUserAssignedToIp200ResponseMetadataNextParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AfterKey** | Pointer to **string** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. | +**Limit** | **string** | The `limit` specified in the request. This parameter will be included only if it was specified in the request. This is not the default limit enforced by the API. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region.md b/rest/api/v3/ip_address_management/docs/Region.md new file mode 100644 index 00000000..e861b3d5 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region.md @@ -0,0 +1,13 @@ +# Region + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"eu"`) +**US** | string | (value: `"us"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region1.md b/rest/api/v3/ip_address_management/docs/Region1.md new file mode 100644 index 00000000..ca0566cb --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region1.md @@ -0,0 +1,14 @@ +# Region1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ALL** | string | (value: `"all"`) +**US** | string | (value: `"us"`) +**EU** | string | (value: `"eu"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region2.md b/rest/api/v3/ip_address_management/docs/Region2.md new file mode 100644 index 00000000..09a272e0 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region2.md @@ -0,0 +1,13 @@ +# Region2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"eu"`) +**US** | string | (value: `"us"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region3.md b/rest/api/v3/ip_address_management/docs/Region3.md new file mode 100644 index 00000000..c39c27e1 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region3.md @@ -0,0 +1,13 @@ +# Region3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"eu"`) +**US** | string | (value: `"us"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region4.md b/rest/api/v3/ip_address_management/docs/Region4.md new file mode 100644 index 00000000..928b038b --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region4.md @@ -0,0 +1,14 @@ +# Region4 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ALL** | string | (value: `"all"`) +**US** | string | (value: `"us"`) +**EU** | string | (value: `"eu"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region5.md b/rest/api/v3/ip_address_management/docs/Region5.md new file mode 100644 index 00000000..2e619fff --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region5.md @@ -0,0 +1,13 @@ +# Region5 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**US** | string | (value: `"us"`) +**EU** | string | (value: `"eu"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region6.md b/rest/api/v3/ip_address_management/docs/Region6.md new file mode 100644 index 00000000..9a492375 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region6.md @@ -0,0 +1,13 @@ +# Region6 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"eu"`) +**US** | string | (value: `"us"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/Region7.md b/rest/api/v3/ip_address_management/docs/Region7.md new file mode 100644 index 00000000..c7db2ec2 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/Region7.md @@ -0,0 +1,14 @@ +# Region7 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ALL** | string | (value: `"all"`) +**EU** | string | (value: `"eu"`) +**US** | string | (value: `"us"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/UpdateIp.md b/rest/api/v3/ip_address_management/docs/UpdateIp.md new file mode 100644 index 00000000..4dffc656 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/UpdateIp.md @@ -0,0 +1,52 @@ +# UpdateIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateIp**](UpdateIp.md#UpdateIp) | **Patch** /v3/send_ips/ips/{Ip} | Update Details for an IP Address + + + +## UpdateIp + +> UpdateIp200Response UpdateIp(ctx, Ipoptional) + +Update Details for an IP Address + +This operation updates an IP address's settings, including whether the IP is set to warm up automatically, if the IP is assigned by a parent account, and whether the IP is enabled or disabled. The request body must include at least one of the `is_auto_warmup`, `is_parent_assigned`, or `is_enabled` fields. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Ip** | **string** | The `ip` path parameter specifies an IP address to make the request against. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateIpRequest** | [**UpdateIpRequest**](UpdateIpRequest.md) | + +### Return type + +[**UpdateIp200Response**](UpdateIp200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/UpdateIp200Response.md b/rest/api/v3/ip_address_management/docs/UpdateIp200Response.md new file mode 100644 index 00000000..ed2bc116 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/UpdateIp200Response.md @@ -0,0 +1,14 @@ +# UpdateIp200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address that was updated. |[optional] +**IsAutoWarmup** | **bool** | Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). |[optional] +**IsParentAssigned** | **bool** | Indicates if a parent on the account is able to send email from the IP address. This parameter is returned only if the IP address is parent assigned. |[optional] +**IsEnabled** | **bool** | An array of Subuser IDs the IP address was assigned to. This parameter is returned only if the IP address is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/UpdateIpPool.md b/rest/api/v3/ip_address_management/docs/UpdateIpPool.md new file mode 100644 index 00000000..ab0e11fd --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/UpdateIpPool.md @@ -0,0 +1,52 @@ +# UpdateIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateIpPool**](UpdateIpPool.md#UpdateIpPool) | **Put** /v3/send_ips/pools/{Poolid} | Update an IP Pool Name + + + +## UpdateIpPool + +> UpdateIpPool200Response UpdateIpPool(ctx, Poolidoptional) + +Update an IP Pool Name + +This operation will rename an IP Pool. An IP Pool name cannot start with a dot/period (.) or space. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Poolid** | **string** | Specifies the unique ID for an IP Pool. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateIpPoolRequest** | [**UpdateIpPoolRequest**](UpdateIpPoolRequest.md) | + +### Return type + +[**UpdateIpPool200Response**](UpdateIpPool200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_address_management/docs/UpdateIpPool200Response.md b/rest/api/v3/ip_address_management/docs/UpdateIpPool200Response.md new file mode 100644 index 00000000..787fe0cc --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/UpdateIpPool200Response.md @@ -0,0 +1,12 @@ +# UpdateIpPool200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name assigned to the IP Pool. |[optional] +**Id** | **string** | The unique ID of the IP Pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/UpdateIpPoolRequest.md b/rest/api/v3/ip_address_management/docs/UpdateIpPoolRequest.md new file mode 100644 index 00000000..30357410 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/UpdateIpPoolRequest.md @@ -0,0 +1,11 @@ +# UpdateIpPoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name to assign to the IP Pool. An IP Pool name cannot begin with a space or period. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/docs/UpdateIpRequest.md b/rest/api/v3/ip_address_management/docs/UpdateIpRequest.md new file mode 100644 index 00000000..a3c255d2 --- /dev/null +++ b/rest/api/v3/ip_address_management/docs/UpdateIpRequest.md @@ -0,0 +1,13 @@ +# UpdateIpRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IsAutoWarmup** | **bool** | Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). |[optional] +**IsParentAssigned** | **bool** | Indicates if a parent on the account is able to send email from the IP address. |[optional] +**IsEnabled** | **bool** | Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_address_management/model_add_ip_201_response.go b/rest/api/v3/ip_address_management/model_add_ip_201_response.go new file mode 100644 index 00000000..7efdcac8 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_add_ip_201_response.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIp201Response struct for AddIp201Response +type AddIp201Response struct { + // The IP address that was added to your account. + Ip *string `json:"ip,omitempty"` + // Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). This parameter is returned only if the IP address is set to automatically warm up. + IsAutoWarmup *bool `json:"is_auto_warmup,omitempty"` + // Indicates if a parent on the account is able to send email from the IP address. + IsParentAssigned *bool `json:"is_parent_assigned,omitempty"` + // An array of Subuser IDs the IP address was assigned to. + Subusers *[]string `json:"subusers,omitempty"` + // The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + Region *Region2 `json:"region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_add_ip_request.go b/rest/api/v3/ip_address_management/model_add_ip_request.go new file mode 100644 index 00000000..919d2b8a --- /dev/null +++ b/rest/api/v3/ip_address_management/model_add_ip_request.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpRequest struct for AddIpRequest +type AddIpRequest struct { + // Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). + IsAutoWarmup bool `json:"is_auto_warmup"` + // Indicates if a parent on the account is able to send email from the IP address. + IsParentAssigned bool `json:"is_parent_assigned"` + // An array of Subuser IDs the IP address will be assigned to. + Subusers *[]string `json:"subusers,omitempty"` + // The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + Region *Region3 `json:"region,omitempty"` + // Boolean indicating whether or not to return the IP address's region information in the response. + IncludeRegion *bool `json:"include_region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_200_response.go b/rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_200_response.go new file mode 100644 index 00000000..98259263 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_200_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpsToIpPool200Response struct for AddIpsToIpPool200Response +type AddIpsToIpPool200Response struct { + // The name of the IP Pool. + Name *string `json:"name,omitempty"` + // The unique ID of the IP Pool. + Id *string `json:"id,omitempty"` + // An array of IP addresses assigned to the IP Pool. + Ips *[]string `json:"ips,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_request.go b/rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_request.go new file mode 100644 index 00000000..e6bc299e --- /dev/null +++ b/rest/api/v3/ip_address_management/model_add_ips_to_ip_pool_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpsToIpPoolRequest struct for AddIpsToIpPoolRequest +type AddIpsToIpPoolRequest struct { + // An array of IP addresses to assign to the specified IP Pool. All assignments must succeed. + Ips []string `json:"ips"` +} diff --git a/rest/api/v3/ip_address_management/model_add_sub_users_to_ip_200_response.go b/rest/api/v3/ip_address_management/model_add_sub_users_to_ip_200_response.go new file mode 100644 index 00000000..c565c49b --- /dev/null +++ b/rest/api/v3/ip_address_management/model_add_sub_users_to_ip_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddSubUsersToIp200Response struct for AddSubUsersToIp200Response +type AddSubUsersToIp200Response struct { + // The IP address the Subusers were assigned to. + Ip *string `json:"ip,omitempty"` + // An array of Subuser IDs that were assigned to the specified IP address. + Subusers *[]string `json:"subusers,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_add_sub_users_to_ip_request.go b/rest/api/v3/ip_address_management/model_add_sub_users_to_ip_request.go new file mode 100644 index 00000000..72670bf6 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_add_sub_users_to_ip_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddSubUsersToIpRequest struct for AddSubUsersToIpRequest +type AddSubUsersToIpRequest struct { + // An array of Subuser IDs to be assigned to the specified IP address. All Subuser assignments must succeed. + Subusers []string `json:"subusers"` +} diff --git a/rest/api/v3/ip_address_management/model_create_ip_pool_201_response.go b/rest/api/v3/ip_address_management/model_create_ip_pool_201_response.go new file mode 100644 index 00000000..8fa8d726 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_create_ip_pool_201_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateIpPool201Response struct for CreateIpPool201Response +type CreateIpPool201Response struct { + // The name assigned to the IP Pool. + Name *string `json:"name,omitempty"` + // The unique ID of the IP Pool. + Id *string `json:"id,omitempty"` + // An array of IP addresses assigned to the IP Pool. All assignments must succeed. + Ips *[]string `json:"ips,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_create_ip_pool_request.go b/rest/api/v3/ip_address_management/model_create_ip_pool_request.go new file mode 100644 index 00000000..c702be5a --- /dev/null +++ b/rest/api/v3/ip_address_management/model_create_ip_pool_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateIpPoolRequest struct for CreateIpPoolRequest +type CreateIpPoolRequest struct { + // The name to assign to the IP Pool. An IP Pool name cannot begin with a space or period. + Name string `json:"name"` + // An array of IP addresses to assign to the IP Pool. All assignments must succeed. + Ips *[]string `json:"ips,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_delete_ips_from_ip_pool_request.go b/rest/api/v3/ip_address_management/model_delete_ips_from_ip_pool_request.go new file mode 100644 index 00000000..f61bee66 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_delete_ips_from_ip_pool_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteIpsFromIpPoolRequest struct for DeleteIpsFromIpPoolRequest +type DeleteIpsFromIpPoolRequest struct { + // An array of IP addresses to remove from the specified IP Pool. + Ips []string `json:"ips"` +} diff --git a/rest/api/v3/ip_address_management/model_delete_sub_users_from_ip_request.go b/rest/api/v3/ip_address_management/model_delete_sub_users_from_ip_request.go new file mode 100644 index 00000000..b558ec05 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_delete_sub_users_from_ip_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteSubUsersFromIpRequest struct for DeleteSubUsersFromIpRequest +type DeleteSubUsersFromIpRequest struct { + // An array of Subuser IDs to be removed from the specified IP address. + Subusers []string `json:"subusers"` +} diff --git a/rest/api/v3/ip_address_management/model_get_ip_200_response.go b/rest/api/v3/ip_address_management/model_get_ip_200_response.go new file mode 100644 index 00000000..e9e90214 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_get_ip_200_response.go @@ -0,0 +1,36 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIp200Response struct for GetIp200Response +type GetIp200Response struct { + // The IP address specified in the request. + Ip *string `json:"ip,omitempty"` + // Indicates if a parent on the account is able to send email from the IP address. + IsParentAssigned *bool `json:"is_parent_assigned,omitempty"` + // Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). + IsAutoWarmup *bool `json:"is_auto_warmup,omitempty"` + // An array of IP Pools the IP address is assigned to. + Pools *[]GetIp200ResponsePoolsInner `json:"pools,omitempty"` + // A timestamp indicating when the IP address was added to your account. + AddedAt *int32 `json:"added_at,omitempty"` + // A timestamp indicating when the IP was last updated. + UpdatedAt *int32 `json:"updated_at,omitempty"` + // Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. + IsEnabled *bool `json:"is_enabled,omitempty"` + // Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. + IsLeased *bool `json:"is_leased,omitempty"` + // The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. Possible values are `us` or `eu`. + Region *string `json:"region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_get_ip_200_response_pools_inner.go b/rest/api/v3/ip_address_management/model_get_ip_200_response_pools_inner.go new file mode 100644 index 00000000..36e7d5ee --- /dev/null +++ b/rest/api/v3/ip_address_management/model_get_ip_200_response_pools_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIp200ResponsePoolsInner struct for GetIp200ResponsePoolsInner +type GetIp200ResponsePoolsInner struct { + // The ID of the IP Pool. + Id *string `json:"id,omitempty"` + // The name of the IP Pool. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_get_ip_pool_200_response.go b/rest/api/v3/ip_address_management/model_get_ip_pool_200_response.go new file mode 100644 index 00000000..cd1b5410 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_get_ip_pool_200_response.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIpPool200Response struct for GetIpPool200Response +type GetIpPool200Response struct { + // The name of the IP Pool. + Name *string `json:"name,omitempty"` + // The unique ID of the IP Pool. + Id *string `json:"id,omitempty"` + // A sample list of IP addresses associated with the IP Pool. The sample is limited to 10 results. + IpsPreview *[]string `json:"ips_preview,omitempty"` + // The total number of IP addresses in the IP Pool. An IP Pool can have a maximum of 100 associated IP addresses. + TotalIpCount *int32 `json:"total_ip_count,omitempty"` + // The total number of IP addresses by region. this object is only returned if the `include_region` parameter is included and set to `true` in the API request. + IpCountByRegion *[]GetIpPool200ResponseIpCountByRegionInner `json:"ip_count_by_region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_get_ip_pool_200_response_ip_count_by_region_inner.go b/rest/api/v3/ip_address_management/model_get_ip_pool_200_response_ip_count_by_region_inner.go new file mode 100644 index 00000000..e16b374a --- /dev/null +++ b/rest/api/v3/ip_address_management/model_get_ip_pool_200_response_ip_count_by_region_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIpPool200ResponseIpCountByRegionInner struct for GetIpPool200ResponseIpCountByRegionInner +type GetIpPool200ResponseIpCountByRegionInner struct { + // The region associated with the number of IPs listed in the `count` property. + Region *Region5 `json:"region,omitempty"` + // The number of IP addresses in the pool that are assigned to the region specified in the `region` property for this count. + Count *int32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_ip_address_management_error_response.go b/rest/api/v3/ip_address_management/model_ip_address_management_error_response.go new file mode 100644 index 00000000..a9104eff --- /dev/null +++ b/rest/api/v3/ip_address_management/model_ip_address_management_error_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IpAddressManagementErrorResponse IP Address Management Error Response Schema +type IpAddressManagementErrorResponse struct { + // An array of error objects. + Errors *[]IpAddressManagementErrorResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_ip_address_management_error_response_errors_inner.go b/rest/api/v3/ip_address_management/model_ip_address_management_error_response_errors_inner.go new file mode 100644 index 00000000..731e72c3 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_ip_address_management_error_response_errors_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IpAddressManagementErrorResponseErrorsInner struct for IpAddressManagementErrorResponseErrorsInner +type IpAddressManagementErrorResponseErrorsInner struct { + // Indicates which field caused the error. This may be an empty string if no specific field is responsible for the error. + Field *string `json:"field,omitempty"` + // An error-specific message that provides more information about the error's cause. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_items.go b/rest/api/v3/ip_address_management/model_items.go new file mode 100644 index 00000000..87d3f404 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_items.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items the model 'Items' +type Items string + +// List of Items +const ( + ITEMS_EU Items = "eu" + ITEMS_US Items = "us" +) diff --git a/rest/api/v3/ip_address_management/model_list_ip_200_response.go b/rest/api/v3/ip_address_management/model_list_ip_200_response.go new file mode 100644 index 00000000..9ad4f44c --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIp200Response struct for ListIp200Response +type ListIp200Response struct { + Result *[]ListIp200ResponseResultInner `json:"result,omitempty"` + Metadata *ListIp200ResponseMetadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_200_response__metadata.go b/rest/api/v3/ip_address_management/model_list_ip_200_response__metadata.go new file mode 100644 index 00000000..6607e47c --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_200_response__metadata.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIp200ResponseMetadata struct for ListIp200ResponseMetadata +type ListIp200ResponseMetadata struct { + NextParams *ListIp200ResponseMetadataNextParams `json:"next_params,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_200_response__metadata_next_params.go b/rest/api/v3/ip_address_management/model_list_ip_200_response__metadata_next_params.go new file mode 100644 index 00000000..51a639b8 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_200_response__metadata_next_params.go @@ -0,0 +1,42 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIp200ResponseMetadataNextParams struct for ListIp200ResponseMetadataNextParams +type ListIp200ResponseMetadataNextParams struct { + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. + AfterKey *string `json:"after_key,omitempty"` + // Specifies which items to be returned by the API. When the `before_key` is specified, the API will return items beginning from the first item before the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `before_key` cannot be used in combination with the `after_key` parameter. + BeforeKey *string `json:"before_key,omitempty"` + // The IP address specified in the request with the `ip` query parameter. This parameter is returned only when an IP is included in the request. + Ip *string `json:"ip,omitempty"` + // Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. This parameter is returned only if the IP address is leased. + IsLeased *bool `json:"is_leased,omitempty"` + // Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. This parameter is returned only if the IP address is enabled. + IsEnabled *bool `json:"is_enabled,omitempty"` + // Indicates if a parent on the account is able to send email from the IP address. This parameter is returned only if the IP address is parent assigned. + IsParentAssigned *bool `json:"is_parent_assigned,omitempty"` + // The IP Pool ID specified in the request with the `pool` query parameter. This parameter is returned only when an IP Pool is included in the request. + Pool *string `json:"pool,omitempty"` + // The beginning of the time window specified in the request with the `start_added_at` query parameter. This parameter is returned only when the `start_added_at` parameter is included in the request. + StartAddedAt *string `json:"start_added_at,omitempty"` + // The end of the time window specified in the request with the `end_added_at` query parameter. This parameter is returned only when the `end_added_at` parameter is included in the request. + EndAddedAt *string `json:"end_added_at,omitempty"` + // The number of items returned in the request. This parameter is returned only when a `limit` is set using the `limit` query parameter in the request. + Limit *string `json:"limit,omitempty"` + // The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request, + Region *Region1 `json:"region,omitempty"` + // Indicates whether or not to include the IP address's region. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + IncludeRegion *string `json:"include_region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner.go b/rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner.go new file mode 100644 index 00000000..594cf786 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner.go @@ -0,0 +1,36 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIp200ResponseResultInner struct for ListIp200ResponseResultInner +type ListIp200ResponseResultInner struct { + // An IP address on your account. + Ip *string `json:"ip,omitempty"` + // An array of IP Pools the IP address is assigned to. + Pools *[]ListIp200ResponseResultInnerPoolsInner `json:"pools,omitempty"` + // Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). + IsAutoWarmup *bool `json:"is_auto_warmup,omitempty"` + // Indicates if a parent on the account is able to send email from the IP address. This parameter will be returned only if the request was made by the parent account. + IsParentAssigned *bool `json:"is_parent_assigned,omitempty"` + // A timestamp indicating when the IP was last updated. + UpdatedAt *int32 `json:"updated_at,omitempty"` + // Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. + IsEnabled *bool `json:"is_enabled,omitempty"` + // Indicates whether an IP address is leased from Twilio SendGrid. If `false`, the IP address is not a Twilio SendGrid IP; it is a customer's own IP that has been added to their Twilio SendGrid account. + IsLeased *bool `json:"is_leased,omitempty"` + // A timestamp representing when the IP address was added to your account. + AddedAt *int32 `json:"added_at,omitempty"` + // The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + Region *Region `json:"region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner_pools_inner.go b/rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner_pools_inner.go new file mode 100644 index 00000000..c16d1584 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_200_response_result_inner_pools_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIp200ResponseResultInnerPoolsInner struct for ListIp200ResponseResultInnerPoolsInner +type ListIp200ResponseResultInnerPoolsInner struct { + // The name of the IP Pool. + Name *string `json:"name,omitempty"` + // The unique ID of the IP Pool. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response.go b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response.go new file mode 100644 index 00000000..9ba7de72 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpAssignedToIpPool200Response struct for ListIpAssignedToIpPool200Response +type ListIpAssignedToIpPool200Response struct { + Result *[]ListIpAssignedToIpPool200ResponseResultInner `json:"result,omitempty"` + Metadata *ListIpAssignedToIpPool200ResponseMetadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata.go b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata.go new file mode 100644 index 00000000..4ba29e47 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpAssignedToIpPool200ResponseMetadata struct for ListIpAssignedToIpPool200ResponseMetadata +type ListIpAssignedToIpPool200ResponseMetadata struct { + NextParams *ListIpAssignedToIpPool200ResponseMetadataNextParams `json:"next_params,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata_next_params.go b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata_next_params.go new file mode 100644 index 00000000..2849251f --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response__metadata_next_params.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpAssignedToIpPool200ResponseMetadataNextParams A collection of fields that can be used to work the endpoint. +type ListIpAssignedToIpPool200ResponseMetadataNextParams struct { + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. + AfterKey *string `json:"after_key,omitempty"` + // The `limit` specified in the request. This parameter will be included only if it was specified in the request. This is not the default limit enforced by the API. + Limit *string `json:"limit,omitempty"` + // Indicates whether or not to include the IP address's region. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + IncludeRegion *string `json:"include_region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response_result_inner.go b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response_result_inner.go new file mode 100644 index 00000000..29a22c36 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_assigned_to_ip_pool_200_response_result_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpAssignedToIpPool200ResponseResultInner struct for ListIpAssignedToIpPool200ResponseResultInner +type ListIpAssignedToIpPool200ResponseResultInner struct { + // An IP address assigned to the IP Pool. + Ip *string `json:"ip,omitempty"` + // The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + Region *Region6 `json:"region,omitempty"` + // IP Pools the IP address is assigned to. + Pools *[]ListIp200ResponseResultInnerPoolsInner `json:"pools,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_pool_200_response.go b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response.go new file mode 100644 index 00000000..8e432462 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpPool200Response struct for ListIpPool200Response +type ListIpPool200Response struct { + Result *[]ListIpPool200ResponseResultInner `json:"result,omitempty"` + Metadata *ListIpPool200ResponseMetadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata.go b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata.go new file mode 100644 index 00000000..1d7363c6 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpPool200ResponseMetadata struct for ListIpPool200ResponseMetadata +type ListIpPool200ResponseMetadata struct { + NextParams *ListIpPool200ResponseMetadataNextParams `json:"next_params,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata_next_params.go b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata_next_params.go new file mode 100644 index 00000000..7b965b61 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response__metadata_next_params.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpPool200ResponseMetadataNextParams A collection of fields that can be used to work the endpoint. +type ListIpPool200ResponseMetadataNextParams struct { + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. + AfterKey *string `json:"after_key,omitempty"` + // The IP address specified in the request. This parameter will be returned only if it was specified in the request. + Ip *string `json:"ip,omitempty"` + // The `limit` specified in the request. This parameter will be included only if it was specified in the request. This is not the default limit enforced by the API. + Limit *string `json:"limit,omitempty"` + // The region to which the IP address is assigned. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + Region *Region4 `json:"region,omitempty"` + // Indicates whether or not to include the IP address's region. This property will only be returned if the `include_region` query parameter is included and set to `true` as part of the API request. + IncludeRegion *string `json:"include_region,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_ip_pool_200_response_result_inner.go b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response_result_inner.go new file mode 100644 index 00000000..002e0453 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_ip_pool_200_response_result_inner.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIpPool200ResponseResultInner struct for ListIpPool200ResponseResultInner +type ListIpPool200ResponseResultInner struct { + // The name of the IP Pool. + Name *string `json:"name,omitempty"` + // The unique ID of the IP Pool. + Id *string `json:"id,omitempty"` + // An array of the unique regions of all the IP addresses returned within the IP pool. + Regions *[]Items `json:"regions,omitempty"` + // A sample list of IP addresses associated with the IP Pool. The sample is limited to 10 results. + IpsPreview *[]string `json:"ips_preview,omitempty"` + // The total number of IP addresses in the IP Pool. An IP Pool can have a maximum of 100 associated IP addresses. + TotalIpCount *int32 `json:"total_ip_count,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response.go b/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response.go new file mode 100644 index 00000000..90af39cf --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubUserAssignedToIp200Response struct for ListSubUserAssignedToIp200Response +type ListSubUserAssignedToIp200Response struct { + // An array of Subuser IDs that have been assigned the specified IP address. + Result *[]string `json:"result,omitempty"` + Metadata *ListSubUserAssignedToIp200ResponseMetadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata.go b/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata.go new file mode 100644 index 00000000..5b8c875a --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubUserAssignedToIp200ResponseMetadata struct for ListSubUserAssignedToIp200ResponseMetadata +type ListSubUserAssignedToIp200ResponseMetadata struct { + NextParams *ListSubUserAssignedToIp200ResponseMetadataNextParams `json:"next_params,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata_next_params.go b/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata_next_params.go new file mode 100644 index 00000000..4f1dad9c --- /dev/null +++ b/rest/api/v3/ip_address_management/model_list_sub_user_assigned_to_ip_200_response__metadata_next_params.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubUserAssignedToIp200ResponseMetadataNextParams A collection of fields that can be used to work the endpoint. +type ListSubUserAssignedToIp200ResponseMetadataNextParams struct { + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. The `after_key` cannot be used in combination with the `before_key` parameter. + AfterKey *string `json:"after_key,omitempty"` + // The `limit` specified in the request. This parameter will be included only if it was specified in the request. This is not the default limit enforced by the API. + Limit *string `json:"limit,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_region.go b/rest/api/v3/ip_address_management/model_region.go new file mode 100644 index 00000000..5821628d --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region the model 'Region' +type Region string + +// List of Region +const ( + REGION_EU Region = "eu" + REGION_US Region = "us" +) diff --git a/rest/api/v3/ip_address_management/model_region1.go b/rest/api/v3/ip_address_management/model_region1.go new file mode 100644 index 00000000..a6404f11 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region1 the model 'Region1' +type Region1 string + +// List of Region1 +const ( + REGION1_ALL Region1 = "all" + REGION1_US Region1 = "us" + REGION1_EU Region1 = "eu" +) diff --git a/rest/api/v3/ip_address_management/model_region2.go b/rest/api/v3/ip_address_management/model_region2.go new file mode 100644 index 00000000..ec82c157 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region2 the model 'Region2' +type Region2 string + +// List of Region2 +const ( + REGION2_EU Region2 = "eu" + REGION2_US Region2 = "us" +) diff --git a/rest/api/v3/ip_address_management/model_region3.go b/rest/api/v3/ip_address_management/model_region3.go new file mode 100644 index 00000000..ea2e6c10 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region3.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region3 the model 'Region3' +type Region3 string + +// List of Region3 +const ( + REGION3_EU Region3 = "eu" + REGION3_US Region3 = "us" +) diff --git a/rest/api/v3/ip_address_management/model_region4.go b/rest/api/v3/ip_address_management/model_region4.go new file mode 100644 index 00000000..9ccd77db --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region4.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region4 the model 'Region4' +type Region4 string + +// List of Region4 +const ( + REGION4_ALL Region4 = "all" + REGION4_US Region4 = "us" + REGION4_EU Region4 = "eu" +) diff --git a/rest/api/v3/ip_address_management/model_region5.go b/rest/api/v3/ip_address_management/model_region5.go new file mode 100644 index 00000000..888ec48e --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region5.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region5 the model 'Region5' +type Region5 string + +// List of Region5 +const ( + REGION5_US Region5 = "us" + REGION5_EU Region5 = "eu" +) diff --git a/rest/api/v3/ip_address_management/model_region6.go b/rest/api/v3/ip_address_management/model_region6.go new file mode 100644 index 00000000..df05d87e --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region6.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region6 the model 'Region6' +type Region6 string + +// List of Region6 +const ( + REGION6_EU Region6 = "eu" + REGION6_US Region6 = "us" +) diff --git a/rest/api/v3/ip_address_management/model_region7.go b/rest/api/v3/ip_address_management/model_region7.go new file mode 100644 index 00000000..e6136ec0 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_region7.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region7 the model 'Region7' +type Region7 string + +// List of Region7 +const ( + REGION7_ALL Region7 = "all" + REGION7_EU Region7 = "eu" + REGION7_US Region7 = "us" +) diff --git a/rest/api/v3/ip_address_management/model_update_ip_200_response.go b/rest/api/v3/ip_address_management/model_update_ip_200_response.go new file mode 100644 index 00000000..de980353 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_update_ip_200_response.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateIp200Response struct for UpdateIp200Response +type UpdateIp200Response struct { + // The IP address that was updated. + Ip *string `json:"ip,omitempty"` + // Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). + IsAutoWarmup *bool `json:"is_auto_warmup,omitempty"` + // Indicates if a parent on the account is able to send email from the IP address. This parameter is returned only if the IP address is parent assigned. + IsParentAssigned *bool `json:"is_parent_assigned,omitempty"` + // An array of Subuser IDs the IP address was assigned to. This parameter is returned only if the IP address is enabled. + IsEnabled *bool `json:"is_enabled,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_update_ip_pool_200_response.go b/rest/api/v3/ip_address_management/model_update_ip_pool_200_response.go new file mode 100644 index 00000000..53bb550b --- /dev/null +++ b/rest/api/v3/ip_address_management/model_update_ip_pool_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateIpPool200Response struct for UpdateIpPool200Response +type UpdateIpPool200Response struct { + // The name assigned to the IP Pool. + Name *string `json:"name,omitempty"` + // The unique ID of the IP Pool. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/ip_address_management/model_update_ip_pool_request.go b/rest/api/v3/ip_address_management/model_update_ip_pool_request.go new file mode 100644 index 00000000..28600e4e --- /dev/null +++ b/rest/api/v3/ip_address_management/model_update_ip_pool_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateIpPoolRequest struct for UpdateIpPoolRequest +type UpdateIpPoolRequest struct { + // The name to assign to the IP Pool. An IP Pool name cannot begin with a space or period. + Name string `json:"name"` +} diff --git a/rest/api/v3/ip_address_management/model_update_ip_request.go b/rest/api/v3/ip_address_management/model_update_ip_request.go new file mode 100644 index 00000000..1d627eb2 --- /dev/null +++ b/rest/api/v3/ip_address_management/model_update_ip_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address Management API +* The Twilio SendGrid IP Address Management API combines functionality that was previously split between the Twilio SendGrid [IP Address API](https://docs.sendgrid.com/api-reference/ip-address) and [IP Pools API](https://docs.sendgrid.com/api-reference/ip-pools). This functionality includes adding IP addresses to your account, assigning IP addresses to IP Pools and Subusers, among other tasks. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateIpRequest struct for UpdateIpRequest +type UpdateIpRequest struct { + // Indicates if the IP address is set to automatically [warmup](https://docs.sendgrid.com/ui/sending-email/warming-up-an-ip-address). + IsAutoWarmup *bool `json:"is_auto_warmup,omitempty"` + // Indicates if a parent on the account is able to send email from the IP address. + IsParentAssigned *bool `json:"is_parent_assigned,omitempty"` + // Indicates if the IP address is billed and able to send email. This parameter applies to non-Twilio SendGrid APIs that been added to your Twilio SendGrid account. This parameter's value is `null` for Twilio SendGrid IP addresses. + IsEnabled *bool `json:"is_enabled,omitempty"` +} diff --git a/rest/api/v3/ip_warmup/README.md b/rest/api/v3/ip_warmup/README.md new file mode 100644 index 00000000..3658d1ab --- /dev/null +++ b/rest/api/v3/ip_warmup/README.md @@ -0,0 +1,76 @@ +# Go API client for + +The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. + +SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. + +See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. + +You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.498963+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*GetWarmUpIp* | [**GetWarmUpIp**](docs/GetWarmUpIp.md#getwarmupip) | **Get** /v3/ips/warmup/{IpAddress} | Retrieve the warmup status for a specific IP address +*ListWarmUpIp* | [**ListWarmUpIp**](docs/ListWarmUpIp.md#listwarmupip) | **Get** /v3/ips/warmup | Retrieve all IPs currently in warmup +*StopIpWarmUp* | [**StopIpWarmUp**](docs/StopIpWarmUp.md#stopipwarmup) | **Delete** /v3/ips/warmup/{IpAddress} | Stop warming up an IP address +*WarmUpIp* | [**WarmUpIp**](docs/WarmUpIp.md#warmupip) | **Post** /v3/ips/warmup | Start warming up an IP address + + +## Documentation For Models + + - [GetWarmUpIp404Response](GetWarmUpIp404Response.md) + - [GetWarmUpIp404ResponseErrorsInner](GetWarmUpIp404ResponseErrorsInner.md) + - [IpWarmup200Inner](IpWarmup200Inner.md) + - [StopIpWarmUp404Response](StopIpWarmUp404Response.md) + - [StopIpWarmUp404ResponseErrorsInner](StopIpWarmUp404ResponseErrorsInner.md) + - [WarmUpIp404Response](WarmUpIp404Response.md) + - [WarmUpIp404ResponseErrorsInner](WarmUpIp404ResponseErrorsInner.md) + - [WarmUpIpRequest](WarmUpIpRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/ip_warmup/api_get_warm_up_ip.go b/rest/api/v3/ip_warmup/api_get_warm_up_ip.go new file mode 100644 index 00000000..59cc809c --- /dev/null +++ b/rest/api/v3/ip_warmup/api_get_warm_up_ip.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetWarmUpIpParam struct { + // The IP address that you want to retrieve the warmup status for. + IpAddress *string `json:"ip_address"` +} + +func (params *GetWarmUpIpParam) SetIpAddress(IpAddress string) *GetWarmUpIpParam { + params.IpAddress = &IpAddress + return params +} + +// **This endpoint allows you to retrieve the warmup status for a specific IP address.** You can retrieve all of your warming IPs using the \"Retrieve all IPs currently in warmup\" endpoint. +func (c *ApiService) GetWarmUpIp(params *GetWarmUpIpParam) (interface{}, error) { + path := "/v3/ips/warmup/{IpAddress}" + if params != nil && params.IpAddress != nil { + path = strings.Replace(path, "{"+"IpAddress"+"}", *params.IpAddress, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]IpWarmup200Inner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetWarmUpIp404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_warmup/api_list_warm_up_ip.go b/rest/api/v3/ip_warmup/api_list_warm_up_ip.go new file mode 100644 index 00000000..d5c3a84d --- /dev/null +++ b/rest/api/v3/ip_warmup/api_list_warm_up_ip.go @@ -0,0 +1,49 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListWarmUpIpParam struct { +} + +// **This endpoint allows you to retrieve all of your IP addresses that are currently warming up.** +func (c *ApiService) ListWarmUpIp() (interface{}, error) { + path := "/v3/ips/warmup" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]IpWarmup200Inner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_warmup/api_service.go b/rest/api/v3/ip_warmup/api_service.go new file mode 100644 index 00000000..53f0581d --- /dev/null +++ b/rest/api/v3/ip_warmup/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/ip_warmup/api_stop_ip_warm_up.go b/rest/api/v3/ip_warmup/api_stop_ip_warm_up.go new file mode 100644 index 00000000..a907c869 --- /dev/null +++ b/rest/api/v3/ip_warmup/api_stop_ip_warm_up.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type StopIpWarmUpParam struct { + // The IP address that you want to retrieve the warmup status for. + IpAddress *string `json:"ip_address"` +} + +func (params *StopIpWarmUpParam) SetIpAddress(IpAddress string) *StopIpWarmUpParam { + params.IpAddress = &IpAddress + return params +} + +// **This endpoint allows you to remove an IP address from warmup mode.** Your request will return a 204 status code if the specified IP was successfully removed from warmup mode. To retrieve details of the IP’s warmup status *before* removing it from warmup mode, call the \"Retrieve the warmpup status for a specific IP address\" endpoint. +func (c *ApiService) StopIpWarmUp(params *StopIpWarmUpParam) (interface{}, error) { + path := "/v3/ips/warmup/{IpAddress}" + if params != nil && params.IpAddress != nil { + path = strings.Replace(path, "{"+"IpAddress"+"}", *params.IpAddress, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &StopIpWarmUp404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_warmup/api_warm_up_ip.go b/rest/api/v3/ip_warmup/api_warm_up_ip.go new file mode 100644 index 00000000..9e0947f8 --- /dev/null +++ b/rest/api/v3/ip_warmup/api_warm_up_ip.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type WarmUpIpParam struct { + // + WarmUpIpRequest *WarmUpIpRequest `json:"WarmUpIpRequest,omitempty"` +} + +func (params *WarmUpIpParam) SetWarmUpIpRequest(WarmUpIpRequest WarmUpIpRequest) *WarmUpIpParam { + params.WarmUpIpRequest = &WarmUpIpRequest + return params +} + +// **This endpoint allows you to put an IP address into warmup mode.** +func (c *ApiService) WarmUpIp(params *WarmUpIpParam) (interface{}, error) { + path := "/v3/ips/warmup" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.WarmUpIpRequest != nil { + b, err := json.Marshal(*params.WarmUpIpRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]IpWarmup200Inner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &WarmUpIp404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ip_warmup/docs/GetWarmUpIp.md b/rest/api/v3/ip_warmup/docs/GetWarmUpIp.md new file mode 100644 index 00000000..0339c3f5 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/GetWarmUpIp.md @@ -0,0 +1,51 @@ +# GetWarmUpIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetWarmUpIp**](GetWarmUpIp.md#GetWarmUpIp) | **Get** /v3/ips/warmup/{IpAddress} | Retrieve the warmup status for a specific IP address + + + +## GetWarmUpIp + +> []IpWarmup200Inner GetWarmUpIp(ctx, IpAddress) + +Retrieve the warmup status for a specific IP address + +**This endpoint allows you to retrieve the warmup status for a specific IP address.** You can retrieve all of your warming IPs using the \"Retrieve all IPs currently in warmup\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**IpAddress** | **string** | The IP address that you want to retrieve the warmup status for. + +### Other Parameters + +Other parameters are passed through a pointer to a GetWarmUpIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**[]IpWarmup200Inner**](IpWarmup200Inner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_warmup/docs/GetWarmUpIp404Response.md b/rest/api/v3/ip_warmup/docs/GetWarmUpIp404Response.md new file mode 100644 index 00000000..9126d1b7 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/GetWarmUpIp404Response.md @@ -0,0 +1,11 @@ +# GetWarmUpIp404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]GetWarmUpIp404ResponseErrorsInner**](GetWarmUpIp404ResponseErrorsInner.md) | The errors that were encountered. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/docs/GetWarmUpIp404ResponseErrorsInner.md b/rest/api/v3/ip_warmup/docs/GetWarmUpIp404ResponseErrorsInner.md new file mode 100644 index 00000000..64076c11 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/GetWarmUpIp404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# GetWarmUpIp404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | |[optional] +**Message** | **string** | A message explaining why the warmup status could not be retrieved. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/docs/IpWarmup200Inner.md b/rest/api/v3/ip_warmup/docs/IpWarmup200Inner.md new file mode 100644 index 00000000..7a2a6aa0 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/IpWarmup200Inner.md @@ -0,0 +1,12 @@ +# IpWarmup200Inner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address. | +**StartDate** | **int32** | A Unix timestamp indicating when the IP address entered warmup mode. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/docs/ListWarmUpIp.md b/rest/api/v3/ip_warmup/docs/ListWarmUpIp.md new file mode 100644 index 00000000..5944ebf3 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/ListWarmUpIp.md @@ -0,0 +1,44 @@ +# ListWarmUpIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListWarmUpIp**](ListWarmUpIp.md#ListWarmUpIp) | **Get** /v3/ips/warmup | Retrieve all IPs currently in warmup + + + +## ListWarmUpIp + +> []IpWarmup200Inner ListWarmUpIp(ctx, ) + +Retrieve all IPs currently in warmup + +**This endpoint allows you to retrieve all of your IP addresses that are currently warming up.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListWarmUpIpParams struct + + +### Return type + +[**[]IpWarmup200Inner**](IpWarmup200Inner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_warmup/docs/StopIpWarmUp.md b/rest/api/v3/ip_warmup/docs/StopIpWarmUp.md new file mode 100644 index 00000000..e8b5e45b --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/StopIpWarmUp.md @@ -0,0 +1,51 @@ +# StopIpWarmUp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**StopIpWarmUp**](StopIpWarmUp.md#StopIpWarmUp) | **Delete** /v3/ips/warmup/{IpAddress} | Stop warming up an IP address + + + +## StopIpWarmUp + +> map[string]interface{} StopIpWarmUp(ctx, IpAddress) + +Stop warming up an IP address + +**This endpoint allows you to remove an IP address from warmup mode.** Your request will return a 204 status code if the specified IP was successfully removed from warmup mode. To retrieve details of the IP’s warmup status *before* removing it from warmup mode, call the \"Retrieve the warmpup status for a specific IP address\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**IpAddress** | **string** | The IP address that you want to retrieve the warmup status for. + +### Other Parameters + +Other parameters are passed through a pointer to a StopIpWarmUpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_warmup/docs/StopIpWarmUp404Response.md b/rest/api/v3/ip_warmup/docs/StopIpWarmUp404Response.md new file mode 100644 index 00000000..2d45e893 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/StopIpWarmUp404Response.md @@ -0,0 +1,11 @@ +# StopIpWarmUp404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]StopIpWarmUp404ResponseErrorsInner**](StopIpWarmUp404ResponseErrorsInner.md) | The errors that were encountered. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/docs/StopIpWarmUp404ResponseErrorsInner.md b/rest/api/v3/ip_warmup/docs/StopIpWarmUp404ResponseErrorsInner.md new file mode 100644 index 00000000..e3f1a0e8 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/StopIpWarmUp404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# StopIpWarmUp404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | |[optional] +**Message** | **string** | A message explaining why the IP couldn't be removed from warmup. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/docs/WarmUpIp.md b/rest/api/v3/ip_warmup/docs/WarmUpIp.md new file mode 100644 index 00000000..336117c8 --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/WarmUpIp.md @@ -0,0 +1,48 @@ +# WarmUpIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**WarmUpIp**](WarmUpIp.md#WarmUpIp) | **Post** /v3/ips/warmup | Start warming up an IP address + + + +## WarmUpIp + +> []IpWarmup200Inner WarmUpIp(ctx, optional) + +Start warming up an IP address + +**This endpoint allows you to put an IP address into warmup mode.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a WarmUpIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**WarmUpIpRequest** | [**WarmUpIpRequest**](WarmUpIpRequest.md) | + +### Return type + +[**[]IpWarmup200Inner**](IpWarmup200Inner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ip_warmup/docs/WarmUpIp404Response.md b/rest/api/v3/ip_warmup/docs/WarmUpIp404Response.md new file mode 100644 index 00000000..7c3164cf --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/WarmUpIp404Response.md @@ -0,0 +1,11 @@ +# WarmUpIp404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]WarmUpIp404ResponseErrorsInner**](WarmUpIp404ResponseErrorsInner.md) | The errors that were encountered. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/docs/WarmUpIp404ResponseErrorsInner.md b/rest/api/v3/ip_warmup/docs/WarmUpIp404ResponseErrorsInner.md new file mode 100644 index 00000000..82a7d9bc --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/WarmUpIp404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# WarmUpIp404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | |[optional] +**Message** | **string** | A message explaining why the IP couldn't entered into warmup mode. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/docs/WarmUpIpRequest.md b/rest/api/v3/ip_warmup/docs/WarmUpIpRequest.md new file mode 100644 index 00000000..c929749a --- /dev/null +++ b/rest/api/v3/ip_warmup/docs/WarmUpIpRequest.md @@ -0,0 +1,11 @@ +# WarmUpIpRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address that you want to begin warming up. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response.go b/rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response.go new file mode 100644 index 00000000..f61bd268 --- /dev/null +++ b/rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetWarmUpIp404Response struct for GetWarmUpIp404Response +type GetWarmUpIp404Response struct { + // The errors that were encountered. + Errors *[]GetWarmUpIp404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response_errors_inner.go b/rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response_errors_inner.go new file mode 100644 index 00000000..a8376a66 --- /dev/null +++ b/rest/api/v3/ip_warmup/model_get_warm_up_ip_404_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetWarmUpIp404ResponseErrorsInner struct for GetWarmUpIp404ResponseErrorsInner +type GetWarmUpIp404ResponseErrorsInner struct { + Field *string `json:"field,omitempty"` + // A message explaining why the warmup status could not be retrieved. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/ip_warmup/model_ip_warmup200_inner.go b/rest/api/v3/ip_warmup/model_ip_warmup200_inner.go new file mode 100644 index 00000000..f25f10fe --- /dev/null +++ b/rest/api/v3/ip_warmup/model_ip_warmup200_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IpWarmup200Inner struct for IpWarmup200Inner +type IpWarmup200Inner struct { + // The IP address. + Ip string `json:"ip"` + // A Unix timestamp indicating when the IP address entered warmup mode. + StartDate int32 `json:"start_date"` +} diff --git a/rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response.go b/rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response.go new file mode 100644 index 00000000..040be57a --- /dev/null +++ b/rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// StopIpWarmUp404Response struct for StopIpWarmUp404Response +type StopIpWarmUp404Response struct { + // The errors that were encountered. + Errors *[]StopIpWarmUp404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response_errors_inner.go b/rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response_errors_inner.go new file mode 100644 index 00000000..050ce700 --- /dev/null +++ b/rest/api/v3/ip_warmup/model_stop_ip_warm_up_404_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// StopIpWarmUp404ResponseErrorsInner struct for StopIpWarmUp404ResponseErrorsInner +type StopIpWarmUp404ResponseErrorsInner struct { + Field *string `json:"field,omitempty"` + // A message explaining why the IP couldn't be removed from warmup. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/ip_warmup/model_warm_up_ip_404_response.go b/rest/api/v3/ip_warmup/model_warm_up_ip_404_response.go new file mode 100644 index 00000000..64719fc9 --- /dev/null +++ b/rest/api/v3/ip_warmup/model_warm_up_ip_404_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// WarmUpIp404Response struct for WarmUpIp404Response +type WarmUpIp404Response struct { + // The errors that were encountered. + Errors *[]WarmUpIp404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/ip_warmup/model_warm_up_ip_404_response_errors_inner.go b/rest/api/v3/ip_warmup/model_warm_up_ip_404_response_errors_inner.go new file mode 100644 index 00000000..745260ae --- /dev/null +++ b/rest/api/v3/ip_warmup/model_warm_up_ip_404_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// WarmUpIp404ResponseErrorsInner struct for WarmUpIp404ResponseErrorsInner +type WarmUpIp404ResponseErrorsInner struct { + Field *string `json:"field,omitempty"` + // A message explaining why the IP couldn't entered into warmup mode. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/ip_warmup/model_warm_up_ip_request.go b/rest/api/v3/ip_warmup/model_warm_up_ip_request.go new file mode 100644 index 00000000..ac2c2bf4 --- /dev/null +++ b/rest/api/v3/ip_warmup/model_warm_up_ip_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Warmup API +* The Twilio SendGrid IP Warm Up API allows you to gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour. The limit is determined by how long the IP address has been warming up. See the [warmup schedule](https://sendgrid.com/docs/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule) to learn how SendGrid limits your email traffic for IPs in warmup. You can also choose to use Twilio SendGrid's automated IP warmup for any of your IPs from the **IP Addresses** settings menu in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/ip_addresses). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// WarmUpIpRequest struct for WarmUpIpRequest +type WarmUpIpRequest struct { + // The IP address that you want to begin warming up. + Ip *string `json:"ip,omitempty"` +} diff --git a/rest/api/v3/ips/README.md b/rest/api/v3/ips/README.md new file mode 100644 index 00000000..6ee5f096 --- /dev/null +++ b/rest/api/v3/ips/README.md @@ -0,0 +1,95 @@ +# Go API client for + +The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.517402+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AddIp* | [**AddIp**](docs/AddIp.md#addip) | **Post** /v3/ips | Add IPs +*AddIpToIpPool* | [**AddIpToIpPool**](docs/AddIpToIpPool.md#addiptoippool) | **Post** /v3/ips/pools/{PoolName}/ips | Add an IP address to a pool +*CreateIpPool* | [**CreateIpPool**](docs/CreateIpPool.md#createippool) | **Post** /v3/ips/pools | Create an IP pool +*DeleteIpFromIpPool* | [**DeleteIpFromIpPool**](docs/DeleteIpFromIpPool.md#deleteipfromippool) | **Delete** /v3/ips/pools/{PoolName}/ips/{Ip} | Remove an IP address from a pool +*DeleteIpPool* | [**DeleteIpPool**](docs/DeleteIpPool.md#deleteippool) | **Delete** /v3/ips/pools/{PoolName} | Delete an IP pool +*GetIp* | [**GetIp**](docs/GetIp.md#getip) | **Get** /v3/ips/{IpAddress} | Retrieve all IP pools an IP address belongs to +*GetIpPool* | [**GetIpPool**](docs/GetIpPool.md#getippool) | **Get** /v3/ips/pools/{PoolName} | Retrieve all the IPs in a specified pool +*ListAssignedIp* | [**ListAssignedIp**](docs/ListAssignedIp.md#listassignedip) | **Get** /v3/ips/assigned | Retrieve all assigned IPs +*ListIp* | [**ListIp**](docs/ListIp.md#listip) | **Get** /v3/ips | Retrieve all IP addresses +*ListIpPool* | [**ListIpPool**](docs/ListIpPool.md#listippool) | **Get** /v3/ips/pools | Retrieve all IP pools +*ListRemainingIpCount* | [**ListRemainingIpCount**](docs/ListRemainingIpCount.md#listremainingipcount) | **Get** /v3/ips/remaining | Get remaining IPs count +*UpdateIpPool* | [**UpdateIpPool**](docs/UpdateIpPool.md#updateippool) | **Put** /v3/ips/pools/{PoolName} | Rename an IP pool + + +## Documentation For Models + + - [AddIp201Response](AddIp201Response.md) + - [AddIp201ResponseIpsInner](AddIp201ResponseIpsInner.md) + - [AddIpRequest](AddIpRequest.md) + - [AddIpToIpPool201Response](AddIpToIpPool201Response.md) + - [AddIpToIpPool404Response](AddIpToIpPool404Response.md) + - [AddIpToIpPool404ResponseErrorsInner](AddIpToIpPool404ResponseErrorsInner.md) + - [AddIpToIpPoolRequest](AddIpToIpPoolRequest.md) + - [CreateIpPoolRequest](CreateIpPoolRequest.md) + - [DeleteIpFromIpPool404Response](DeleteIpFromIpPool404Response.md) + - [DeleteIpPool404Response](DeleteIpPool404Response.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [GetIp200Response](GetIp200Response.md) + - [GetIpPool200Response](GetIpPool200Response.md) + - [GetIpPool404Response](GetIpPool404Response.md) + - [GetIpPool404ResponseErrorsInner](GetIpPool404ResponseErrorsInner.md) + - [IpPools200](IpPools200.md) + - [ListAssignedIp200ResponseInner](ListAssignedIp200ResponseInner.md) + - [ListIp200ResponseInner](ListIp200ResponseInner.md) + - [ListRemainingIpCount200Response](ListRemainingIpCount200Response.md) + - [ListRemainingIpCount200ResponseResultsInner](ListRemainingIpCount200ResponseResultsInner.md) + - [SortByDirection](SortByDirection.md) + - [UpdateIpPool404Response](UpdateIpPool404Response.md) + - [UpdateIpPool404ResponseErrorsInner](UpdateIpPool404ResponseErrorsInner.md) + - [UpdateIpPoolRequest](UpdateIpPoolRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/ips/api_add_ip.go b/rest/api/v3/ips/api_add_ip.go new file mode 100644 index 00000000..aa9d16b6 --- /dev/null +++ b/rest/api/v3/ips/api_add_ip.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type AddIpParam struct { + // + AddIpRequest *AddIpRequest `json:"AddIpRequest,omitempty"` +} + +func (params *AddIpParam) SetAddIpRequest(AddIpRequest AddIpRequest) *AddIpParam { + params.AddIpRequest = &AddIpRequest + return params +} + +// **This endpoint is for adding a(n) IP Address(es) to your account.** +func (c *ApiService) AddIp(params *AddIpParam) (interface{}, error) { + path := "/v3/ips" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddIpRequest != nil { + b, err := json.Marshal(*params.AddIpRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &AddIp201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_add_ip_to_ip_pool.go b/rest/api/v3/ips/api_add_ip_to_ip_pool.go new file mode 100644 index 00000000..4c78e14c --- /dev/null +++ b/rest/api/v3/ips/api_add_ip_to_ip_pool.go @@ -0,0 +1,84 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type AddIpToIpPoolParam struct { + // The name of the IP pool you want to add the address to. If the name contains spaces, they must be URL encoded (e.g., \"Test Pool\" becomes \"Test%20Pool\"). + PoolName *string `json:"pool_name"` + // + AddIpToIpPoolRequest *AddIpToIpPoolRequest `json:"AddIpToIpPoolRequest,omitempty"` +} + +func (params *AddIpToIpPoolParam) SetPoolName(PoolName string) *AddIpToIpPoolParam { + params.PoolName = &PoolName + return params +} +func (params *AddIpToIpPoolParam) SetAddIpToIpPoolRequest(AddIpToIpPoolRequest AddIpToIpPoolRequest) *AddIpToIpPoolParam { + params.AddIpToIpPoolRequest = &AddIpToIpPoolRequest + return params +} + +// **This endpoint allows you to add an IP address to an IP pool.** You can add the same IP address to multiple pools. It may take up to 60 seconds for your IP address to be added to a pool after your request is made. Before you can add an IP to a pool, you need to activate it in your SendGrid account: 1. Log into your SendGrid account. 1. Navigate to **Settings** and then select **IP Addresses**. 1. Find the IP address you want to activate and then click **Edit**. 1. Check **Allow my account to send mail using this IP address**. 1. Click **Save**. You can retrieve all of your available IP addresses from the \"Retrieve all IP addresses\" endpoint. +func (c *ApiService) AddIpToIpPool(params *AddIpToIpPoolParam) (interface{}, error) { + path := "/v3/ips/pools/{PoolName}/ips" + if params != nil && params.PoolName != nil { + path = strings.Replace(path, "{"+"PoolName"+"}", *params.PoolName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddIpToIpPoolRequest != nil { + b, err := json.Marshal(*params.AddIpToIpPoolRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &AddIpToIpPool201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &AddIpToIpPool404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_create_ip_pool.go b/rest/api/v3/ips/api_create_ip_pool.go new file mode 100644 index 00000000..997942be --- /dev/null +++ b/rest/api/v3/ips/api_create_ip_pool.go @@ -0,0 +1,65 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateIpPoolParam struct { + // + CreateIpPoolRequest *CreateIpPoolRequest `json:"CreateIpPoolRequest,omitempty"` +} + +func (params *CreateIpPoolParam) SetCreateIpPoolRequest(CreateIpPoolRequest CreateIpPoolRequest) *CreateIpPoolParam { + params.CreateIpPoolRequest = &CreateIpPoolRequest + return params +} + +// **This endpoint allows you to create an IP pool.** Before you can create an IP pool, you need to activate the IP in your SendGrid account: 1. Log into your SendGrid account. 1. Navigate to **Settings** and then select **IP Addresses**. 1. Find the IP address you want to activate and then click **Edit**. 1. Check **Allow my account to send mail using this IP address**. 1. Click **Save**. +func (c *ApiService) CreateIpPool(params *CreateIpPoolParam) (interface{}, error) { + path := "/v3/ips/pools" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateIpPoolRequest != nil { + b, err := json.Marshal(*params.CreateIpPoolRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &IpPools200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_delete_ip_from_ip_pool.go b/rest/api/v3/ips/api_delete_ip_from_ip_pool.go new file mode 100644 index 00000000..4588b006 --- /dev/null +++ b/rest/api/v3/ips/api_delete_ip_from_ip_pool.go @@ -0,0 +1,78 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteIpFromIpPoolParam struct { + // The name of the IP pool that you are removing the IP address from. + PoolName *string `json:"pool_name"` + // The IP address that you wish to remove. + Ip *string `json:"ip"` +} + +func (params *DeleteIpFromIpPoolParam) SetPoolName(PoolName string) *DeleteIpFromIpPoolParam { + params.PoolName = &PoolName + return params +} +func (params *DeleteIpFromIpPoolParam) SetIp(Ip string) *DeleteIpFromIpPoolParam { + params.Ip = &Ip + return params +} + +// **This endpoint allows you to remove an IP address from an IP pool.** +func (c *ApiService) DeleteIpFromIpPool(params *DeleteIpFromIpPoolParam) (interface{}, error) { + path := "/v3/ips/pools/{PoolName}/ips/{Ip}" + if params != nil && params.PoolName != nil { + path = strings.Replace(path, "{"+"PoolName"+"}", *params.PoolName, -1) + } + if params != nil && params.Ip != nil { + path = strings.Replace(path, "{"+"Ip"+"}", *params.Ip, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteIpFromIpPool404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_delete_ip_pool.go b/rest/api/v3/ips/api_delete_ip_pool.go new file mode 100644 index 00000000..8284146e --- /dev/null +++ b/rest/api/v3/ips/api_delete_ip_pool.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteIpPoolParam struct { + // The name of the IP pool that you want to retrieve the IP addresses for. + PoolName *string `json:"pool_name"` +} + +func (params *DeleteIpPoolParam) SetPoolName(PoolName string) *DeleteIpPoolParam { + params.PoolName = &PoolName + return params +} + +// **This endpoint allows you to delete an IP pool.** +func (c *ApiService) DeleteIpPool(params *DeleteIpPoolParam) (interface{}, error) { + path := "/v3/ips/pools/{PoolName}" + if params != nil && params.PoolName != nil { + path = strings.Replace(path, "{"+"PoolName"+"}", *params.PoolName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteIpPool404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_get_ip.go b/rest/api/v3/ips/api_get_ip.go new file mode 100644 index 00000000..da116eb4 --- /dev/null +++ b/rest/api/v3/ips/api_get_ip.go @@ -0,0 +1,61 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetIpParam struct { + // The IP address you are retrieving the IP pools for. + IpAddress *string `json:"ip_address"` +} + +func (params *GetIpParam) SetIpAddress(IpAddress string) *GetIpParam { + params.IpAddress = &IpAddress + return params +} + +// **This endpoint allows you to see which IP pools a particular IP address has been added to.** The same IP address can be added to multiple IP pools. A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. +func (c *ApiService) GetIp(params *GetIpParam) (interface{}, error) { + path := "/v3/ips/{IpAddress}" + if params != nil && params.IpAddress != nil { + path = strings.Replace(path, "{"+"IpAddress"+"}", *params.IpAddress, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetIp200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_get_ip_pool.go b/rest/api/v3/ips/api_get_ip_pool.go new file mode 100644 index 00000000..89c54266 --- /dev/null +++ b/rest/api/v3/ips/api_get_ip_pool.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetIpPoolParam struct { + // The name of the IP pool that you want to retrieve the IP addresses for. + PoolName *string `json:"pool_name"` +} + +func (params *GetIpPoolParam) SetPoolName(PoolName string) *GetIpPoolParam { + params.PoolName = &PoolName + return params +} + +// **This endpoint allows you to get all of the IP addresses that are in a specific IP pool.** +func (c *ApiService) GetIpPool(params *GetIpPoolParam) (interface{}, error) { + path := "/v3/ips/pools/{PoolName}" + if params != nil && params.PoolName != nil { + path = strings.Replace(path, "{"+"PoolName"+"}", *params.PoolName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetIpPool200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetIpPool404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_list_assigned_ip.go b/rest/api/v3/ips/api_list_assigned_ip.go new file mode 100644 index 00000000..2fc20788 --- /dev/null +++ b/rest/api/v3/ips/api_list_assigned_ip.go @@ -0,0 +1,49 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListAssignedIpParam struct { +} + +// **This endpoint allows you to retrieve only assigned IP addresses.** A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. +func (c *ApiService) ListAssignedIp() (interface{}, error) { + path := "/v3/ips/assigned" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListAssignedIp200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_list_ip.go b/rest/api/v3/ips/api_list_ip.go new file mode 100644 index 00000000..1837af8b --- /dev/null +++ b/rest/api/v3/ips/api_list_ip.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListIpParam struct { + // The IP address to get + Ip *string `json:"ip,omitempty"` + // Should we exclude reverse DNS records (whitelabels)? + ExcludeWhitelabels *bool `json:"exclude_whitelabels,omitempty"` + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The subuser you are requesting for. + Subuser *string `json:"subuser,omitempty"` + // The direction to sort the results. + SortByDirection *SortByDirection `json:"sort_by_direction,omitempty"` +} + +func (params *ListIpParam) SetIp(Ip string) *ListIpParam { + params.Ip = &Ip + return params +} +func (params *ListIpParam) SetExcludeWhitelabels(ExcludeWhitelabels bool) *ListIpParam { + params.ExcludeWhitelabels = &ExcludeWhitelabels + return params +} +func (params *ListIpParam) SetLimit(Limit int32) *ListIpParam { + params.Limit = &Limit + return params +} +func (params *ListIpParam) SetOffset(Offset int32) *ListIpParam { + params.Offset = &Offset + return params +} +func (params *ListIpParam) SetSubuser(Subuser string) *ListIpParam { + params.Subuser = &Subuser + return params +} +func (params *ListIpParam) SetSortByDirection(SortByDirection SortByDirection) *ListIpParam { + params.SortByDirection = &SortByDirection + return params +} + +// **This endpoint allows you to retrieve a paginated list of all assigned and unassigned IPs.** Response includes warm up status, pools, assigned subusers, and reverse DNS info. The start_date field corresponds to when warmup started for that IP. A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is determined by the aggregate performance of all email traffic sent from it. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListIp(params *ListIpParam) (interface{}, error) { + path := "/v3/ips" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ip != nil { + data.Set("ip", *params.Ip) + } + if params != nil && params.ExcludeWhitelabels != nil { + data.Set("exclude_whitelabels", fmt.Sprint(*params.ExcludeWhitelabels)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.Subuser != nil { + data.Set("subuser", *params.Subuser) + } + if params != nil && params.SortByDirection != nil { + data.Set("sort_by_direction", fmt.Sprint(*params.SortByDirection)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListIp200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_list_ip_pool.go b/rest/api/v3/ips/api_list_ip_pool.go new file mode 100644 index 00000000..3f400732 --- /dev/null +++ b/rest/api/v3/ips/api_list_ip_pool.go @@ -0,0 +1,49 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListIpPoolParam struct { +} + +// **This endpoint allows you to get all of your IP pools.** +func (c *ApiService) ListIpPool() (interface{}, error) { + path := "/v3/ips/pools" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]IpPools200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_list_remaining_ip_count.go b/rest/api/v3/ips/api_list_remaining_ip_count.go new file mode 100644 index 00000000..20a0a88c --- /dev/null +++ b/rest/api/v3/ips/api_list_remaining_ip_count.go @@ -0,0 +1,49 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListRemainingIpCountParam struct { +} + +// **This endpoint gets amount of IP Addresses that can still be created during a given period and the price of those IPs.** +func (c *ApiService) ListRemainingIpCount() (interface{}, error) { + path := "/v3/ips/remaining" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListRemainingIpCount200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/api_service.go b/rest/api/v3/ips/api_service.go new file mode 100644 index 00000000..63970833 --- /dev/null +++ b/rest/api/v3/ips/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/ips/api_update_ip_pool.go b/rest/api/v3/ips/api_update_ip_pool.go new file mode 100644 index 00000000..1dfd77a5 --- /dev/null +++ b/rest/api/v3/ips/api_update_ip_pool.go @@ -0,0 +1,84 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateIpPoolParam struct { + // The name of the IP pool that you want to retrieve the IP addresses for. + PoolName *string `json:"pool_name"` + // + UpdateIpPoolRequest *UpdateIpPoolRequest `json:"UpdateIpPoolRequest,omitempty"` +} + +func (params *UpdateIpPoolParam) SetPoolName(PoolName string) *UpdateIpPoolParam { + params.PoolName = &PoolName + return params +} +func (params *UpdateIpPoolParam) SetUpdateIpPoolRequest(UpdateIpPoolRequest UpdateIpPoolRequest) *UpdateIpPoolParam { + params.UpdateIpPoolRequest = &UpdateIpPoolRequest + return params +} + +// **This endpoint allows you to update the name of an IP pool.** +func (c *ApiService) UpdateIpPool(params *UpdateIpPoolParam) (interface{}, error) { + path := "/v3/ips/pools/{PoolName}" + if params != nil && params.PoolName != nil { + path = strings.Replace(path, "{"+"PoolName"+"}", *params.PoolName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateIpPoolRequest != nil { + b, err := json.Marshal(*params.UpdateIpPoolRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &IpPools200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &UpdateIpPool404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/ips/docs/AddIp.md b/rest/api/v3/ips/docs/AddIp.md new file mode 100644 index 00000000..ec934377 --- /dev/null +++ b/rest/api/v3/ips/docs/AddIp.md @@ -0,0 +1,48 @@ +# AddIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddIp**](AddIp.md#AddIp) | **Post** /v3/ips | Add IPs + + + +## AddIp + +> AddIp201Response AddIp(ctx, optional) + +Add IPs + +**This endpoint is for adding a(n) IP Address(es) to your account.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a AddIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AddIpRequest** | [**AddIpRequest**](AddIpRequest.md) | + +### Return type + +[**AddIp201Response**](AddIp201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/AddIp201Response.md b/rest/api/v3/ips/docs/AddIp201Response.md new file mode 100644 index 00000000..f62ecfe0 --- /dev/null +++ b/rest/api/v3/ips/docs/AddIp201Response.md @@ -0,0 +1,13 @@ +# AddIp201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ips** | [**[]AddIp201ResponseIpsInner**](AddIp201ResponseIpsInner.md) | List of IP objects. | +**RemainingIps** | **int32** | The number of IPs that can still be added to the user. | +**Warmup** | **bool** | Whether or not the IPs are being warmed up. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/AddIp201ResponseIpsInner.md b/rest/api/v3/ips/docs/AddIp201ResponseIpsInner.md new file mode 100644 index 00000000..511cef97 --- /dev/null +++ b/rest/api/v3/ips/docs/AddIp201ResponseIpsInner.md @@ -0,0 +1,12 @@ +# AddIp201ResponseIpsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | IP added to account. | +**Subusers** | **[]string** | Array of usernames assigned a send IP. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/AddIpRequest.md b/rest/api/v3/ips/docs/AddIpRequest.md new file mode 100644 index 00000000..1db399db --- /dev/null +++ b/rest/api/v3/ips/docs/AddIpRequest.md @@ -0,0 +1,13 @@ +# AddIpRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **int32** | The amount of IPs to add to the account. | +**Subusers** | **[]string** | Array of usernames to be assigned a send IP. |[optional] +**Warmup** | **bool** | Whether or not to warmup the IPs being added. |[optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/AddIpToIpPool.md b/rest/api/v3/ips/docs/AddIpToIpPool.md new file mode 100644 index 00000000..77559a2a --- /dev/null +++ b/rest/api/v3/ips/docs/AddIpToIpPool.md @@ -0,0 +1,52 @@ +# AddIpToIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddIpToIpPool**](AddIpToIpPool.md#AddIpToIpPool) | **Post** /v3/ips/pools/{PoolName}/ips | Add an IP address to a pool + + + +## AddIpToIpPool + +> AddIpToIpPool201Response AddIpToIpPool(ctx, PoolNameoptional) + +Add an IP address to a pool + +**This endpoint allows you to add an IP address to an IP pool.** You can add the same IP address to multiple pools. It may take up to 60 seconds for your IP address to be added to a pool after your request is made. Before you can add an IP to a pool, you need to activate it in your SendGrid account: 1. Log into your SendGrid account. 1. Navigate to **Settings** and then select **IP Addresses**. 1. Find the IP address you want to activate and then click **Edit**. 1. Check **Allow my account to send mail using this IP address**. 1. Click **Save**. You can retrieve all of your available IP addresses from the \"Retrieve all IP addresses\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**PoolName** | **string** | The name of the IP pool you want to add the address to. If the name contains spaces, they must be URL encoded (e.g., \"Test Pool\" becomes \"Test%20Pool\"). + +### Other Parameters + +Other parameters are passed through a pointer to a AddIpToIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AddIpToIpPoolRequest** | [**AddIpToIpPoolRequest**](AddIpToIpPoolRequest.md) | + +### Return type + +[**AddIpToIpPool201Response**](AddIpToIpPool201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/AddIpToIpPool201Response.md b/rest/api/v3/ips/docs/AddIpToIpPool201Response.md new file mode 100644 index 00000000..1121a789 --- /dev/null +++ b/rest/api/v3/ips/docs/AddIpToIpPool201Response.md @@ -0,0 +1,14 @@ +# AddIpToIpPool201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address. | +**Pools** | **[]string** | The IP pools that this IP address has been added to. | +**StartDate** | **int32** | A Unix timestamp indicating when the warmup process began for the added IP address. | +**Warmup** | **bool** | Indicates if the IP address is in warmup. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/AddIpToIpPool404Response.md b/rest/api/v3/ips/docs/AddIpToIpPool404Response.md new file mode 100644 index 00000000..ad57ab01 --- /dev/null +++ b/rest/api/v3/ips/docs/AddIpToIpPool404Response.md @@ -0,0 +1,11 @@ +# AddIpToIpPool404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]AddIpToIpPool404ResponseErrorsInner**](AddIpToIpPool404ResponseErrorsInner.md) | The error returned. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/AddIpToIpPool404ResponseErrorsInner.md b/rest/api/v3/ips/docs/AddIpToIpPool404ResponseErrorsInner.md new file mode 100644 index 00000000..8c076206 --- /dev/null +++ b/rest/api/v3/ips/docs/AddIpToIpPool404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# AddIpToIpPool404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | |[optional] +**Message** | **string** | A message explaining why the IP address could not be added to the IP Pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/AddIpToIpPoolRequest.md b/rest/api/v3/ips/docs/AddIpToIpPoolRequest.md new file mode 100644 index 00000000..71990c86 --- /dev/null +++ b/rest/api/v3/ips/docs/AddIpToIpPoolRequest.md @@ -0,0 +1,11 @@ +# AddIpToIpPoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address that you want to add to the named pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/CreateIpPool.md b/rest/api/v3/ips/docs/CreateIpPool.md new file mode 100644 index 00000000..53cb6ad9 --- /dev/null +++ b/rest/api/v3/ips/docs/CreateIpPool.md @@ -0,0 +1,48 @@ +# CreateIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateIpPool**](CreateIpPool.md#CreateIpPool) | **Post** /v3/ips/pools | Create an IP pool + + + +## CreateIpPool + +> IpPools200 CreateIpPool(ctx, optional) + +Create an IP pool + +**This endpoint allows you to create an IP pool.** Before you can create an IP pool, you need to activate the IP in your SendGrid account: 1. Log into your SendGrid account. 1. Navigate to **Settings** and then select **IP Addresses**. 1. Find the IP address you want to activate and then click **Edit**. 1. Check **Allow my account to send mail using this IP address**. 1. Click **Save**. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**CreateIpPoolRequest** | [**CreateIpPoolRequest**](CreateIpPoolRequest.md) | + +### Return type + +[**IpPools200**](IpPools200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/CreateIpPoolRequest.md b/rest/api/v3/ips/docs/CreateIpPoolRequest.md new file mode 100644 index 00000000..22c450a9 --- /dev/null +++ b/rest/api/v3/ips/docs/CreateIpPoolRequest.md @@ -0,0 +1,11 @@ +# CreateIpPoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of your new IP pool. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/DeleteIpFromIpPool.md b/rest/api/v3/ips/docs/DeleteIpFromIpPool.md new file mode 100644 index 00000000..0f701fa8 --- /dev/null +++ b/rest/api/v3/ips/docs/DeleteIpFromIpPool.md @@ -0,0 +1,52 @@ +# DeleteIpFromIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteIpFromIpPool**](DeleteIpFromIpPool.md#DeleteIpFromIpPool) | **Delete** /v3/ips/pools/{PoolName}/ips/{Ip} | Remove an IP address from a pool + + + +## DeleteIpFromIpPool + +> map[string]interface{} DeleteIpFromIpPool(ctx, PoolNameIp) + +Remove an IP address from a pool + +**This endpoint allows you to remove an IP address from an IP pool.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**PoolName** | **string** | The name of the IP pool that you are removing the IP address from. +**Ip** | **string** | The IP address that you wish to remove. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteIpFromIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/DeleteIpFromIpPool404Response.md b/rest/api/v3/ips/docs/DeleteIpFromIpPool404Response.md new file mode 100644 index 00000000..de7496d3 --- /dev/null +++ b/rest/api/v3/ips/docs/DeleteIpFromIpPool404Response.md @@ -0,0 +1,11 @@ +# DeleteIpFromIpPool404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | **string** | An error explaining why the IP address could not be removed from the IP pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/DeleteIpPool.md b/rest/api/v3/ips/docs/DeleteIpPool.md new file mode 100644 index 00000000..1afd2aee --- /dev/null +++ b/rest/api/v3/ips/docs/DeleteIpPool.md @@ -0,0 +1,51 @@ +# DeleteIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteIpPool**](DeleteIpPool.md#DeleteIpPool) | **Delete** /v3/ips/pools/{PoolName} | Delete an IP pool + + + +## DeleteIpPool + +> map[string]interface{} DeleteIpPool(ctx, PoolName) + +Delete an IP pool + +**This endpoint allows you to delete an IP pool.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**PoolName** | **string** | The name of the IP pool that you want to retrieve the IP addresses for. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/DeleteIpPool404Response.md b/rest/api/v3/ips/docs/DeleteIpPool404Response.md new file mode 100644 index 00000000..667bd47e --- /dev/null +++ b/rest/api/v3/ips/docs/DeleteIpPool404Response.md @@ -0,0 +1,11 @@ +# DeleteIpPool404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | **string** | An error explaining why the pool could not be deleted. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/ErrorResponse.md b/rest/api/v3/ips/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/ips/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/ErrorResponseErrorsInner.md b/rest/api/v3/ips/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/ips/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/GetIp.md b/rest/api/v3/ips/docs/GetIp.md new file mode 100644 index 00000000..c9ea8a87 --- /dev/null +++ b/rest/api/v3/ips/docs/GetIp.md @@ -0,0 +1,51 @@ +# GetIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetIp**](GetIp.md#GetIp) | **Get** /v3/ips/{IpAddress} | Retrieve all IP pools an IP address belongs to + + + +## GetIp + +> GetIp200Response GetIp(ctx, IpAddress) + +Retrieve all IP pools an IP address belongs to + +**This endpoint allows you to see which IP pools a particular IP address has been added to.** The same IP address can be added to multiple IP pools. A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**IpAddress** | **string** | The IP address you are retrieving the IP pools for. + +### Other Parameters + +Other parameters are passed through a pointer to a GetIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**GetIp200Response**](GetIp200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/GetIp200Response.md b/rest/api/v3/ips/docs/GetIp200Response.md new file mode 100644 index 00000000..34637db0 --- /dev/null +++ b/rest/api/v3/ips/docs/GetIp200Response.md @@ -0,0 +1,17 @@ +# GetIp200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address. | +**Subusers** | **[]string** | The subusers that can send email using this IP address. | +**Rdns** | **string** | The reverse DNS record for this IP address. | +**Pools** | **[]string** | The list of IP pools that this IP address belongs to. | +**Warmup** | **bool** | Indicates if this IP address is currently warming up. | +**StartDate** | **int32** | The date that the IP address was entered into warmup. | +**Whitelabeled** | **bool** | Indicates if this IP address is associated with a reverse DNS record. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/GetIpPool.md b/rest/api/v3/ips/docs/GetIpPool.md new file mode 100644 index 00000000..8cd51783 --- /dev/null +++ b/rest/api/v3/ips/docs/GetIpPool.md @@ -0,0 +1,51 @@ +# GetIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetIpPool**](GetIpPool.md#GetIpPool) | **Get** /v3/ips/pools/{PoolName} | Retrieve all the IPs in a specified pool + + + +## GetIpPool + +> GetIpPool200Response GetIpPool(ctx, PoolName) + +Retrieve all the IPs in a specified pool + +**This endpoint allows you to get all of the IP addresses that are in a specific IP pool.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**PoolName** | **string** | The name of the IP pool that you want to retrieve the IP addresses for. + +### Other Parameters + +Other parameters are passed through a pointer to a GetIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**GetIpPool200Response**](GetIpPool200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/GetIpPool200Response.md b/rest/api/v3/ips/docs/GetIpPool200Response.md new file mode 100644 index 00000000..6f59aa12 --- /dev/null +++ b/rest/api/v3/ips/docs/GetIpPool200Response.md @@ -0,0 +1,12 @@ +# GetIpPool200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PoolName** | **string** | The name of the IP pool. |[optional] +**Ips** | **[]string** | The IP addresses that belong to this pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/GetIpPool404Response.md b/rest/api/v3/ips/docs/GetIpPool404Response.md new file mode 100644 index 00000000..6e2dcd12 --- /dev/null +++ b/rest/api/v3/ips/docs/GetIpPool404Response.md @@ -0,0 +1,11 @@ +# GetIpPool404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]GetIpPool404ResponseErrorsInner**](GetIpPool404ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/GetIpPool404ResponseErrorsInner.md b/rest/api/v3/ips/docs/GetIpPool404ResponseErrorsInner.md new file mode 100644 index 00000000..03472198 --- /dev/null +++ b/rest/api/v3/ips/docs/GetIpPool404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# GetIpPool404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | The name of the error. |[optional] +**Message** | **string** | A message explaining why the IP addresses could not be listed. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/IpPools200.md b/rest/api/v3/ips/docs/IpPools200.md new file mode 100644 index 00000000..4fcf9926 --- /dev/null +++ b/rest/api/v3/ips/docs/IpPools200.md @@ -0,0 +1,11 @@ +# IpPools200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the IP pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/ListAssignedIp.md b/rest/api/v3/ips/docs/ListAssignedIp.md new file mode 100644 index 00000000..1aed835b --- /dev/null +++ b/rest/api/v3/ips/docs/ListAssignedIp.md @@ -0,0 +1,44 @@ +# ListAssignedIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAssignedIp**](ListAssignedIp.md#ListAssignedIp) | **Get** /v3/ips/assigned | Retrieve all assigned IPs + + + +## ListAssignedIp + +> []ListAssignedIp200ResponseInner ListAssignedIp(ctx, ) + +Retrieve all assigned IPs + +**This endpoint allows you to retrieve only assigned IP addresses.** A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAssignedIpParams struct + + +### Return type + +[**[]ListAssignedIp200ResponseInner**](ListAssignedIp200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/ListAssignedIp200ResponseInner.md b/rest/api/v3/ips/docs/ListAssignedIp200ResponseInner.md new file mode 100644 index 00000000..0992bd04 --- /dev/null +++ b/rest/api/v3/ips/docs/ListAssignedIp200ResponseInner.md @@ -0,0 +1,14 @@ +# ListAssignedIp200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address. | +**Pools** | **[]string** | The IP pools that this IP address has been added to. | +**Warmup** | **bool** | Indicates if this IP address is currently warming up. | +**StartDate** | **int32** | The start date that this IP address was entered into warmup. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/ListIp.md b/rest/api/v3/ips/docs/ListIp.md new file mode 100644 index 00000000..29d02acc --- /dev/null +++ b/rest/api/v3/ips/docs/ListIp.md @@ -0,0 +1,53 @@ +# ListIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListIp**](ListIp.md#ListIp) | **Get** /v3/ips | Retrieve all IP addresses + + + +## ListIp + +> []ListIp200ResponseInner ListIp(ctx, optional) + +Retrieve all IP addresses + +**This endpoint allows you to retrieve a paginated list of all assigned and unassigned IPs.** Response includes warm up status, pools, assigned subusers, and reverse DNS info. The start_date field corresponds to when warmup started for that IP. A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is determined by the aggregate performance of all email traffic sent from it. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Ip** | **string** | The IP address to get +**ExcludeWhitelabels** | **bool** | Should we exclude reverse DNS records (whitelabels)? +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Subuser** | **string** | The subuser you are requesting for. +**SortByDirection** | [**SortByDirection**](SortByDirectionSortByDirection.md) | The direction to sort the results. + +### Return type + +[**[]ListIp200ResponseInner**](ListIp200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/ListIp200ResponseInner.md b/rest/api/v3/ips/docs/ListIp200ResponseInner.md new file mode 100644 index 00000000..7b8e15a9 --- /dev/null +++ b/rest/api/v3/ips/docs/ListIp200ResponseInner.md @@ -0,0 +1,18 @@ +# ListIp200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | An IP address. | +**Subusers** | **[]string** | The subusers that are able to send email from this IP. | +**Rdns** | **string** | The reverse DNS record for this IP address. |[optional] +**Pools** | **[]string** | The IP pools that this IP has been added to. | +**Warmup** | **bool** | Indicates if this IP address is currently warming up. | +**StartDate** | **float32** | The date that the IP address was entered into warmup. | +**Whitelabeled** | **bool** | Indicates if this IP address is associated with a reverse DNS record. | +**AssignedAt** | **int32** | The date that the IP address was assigned to the user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/ListIpPool.md b/rest/api/v3/ips/docs/ListIpPool.md new file mode 100644 index 00000000..56fc7cf8 --- /dev/null +++ b/rest/api/v3/ips/docs/ListIpPool.md @@ -0,0 +1,44 @@ +# ListIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListIpPool**](ListIpPool.md#ListIpPool) | **Get** /v3/ips/pools | Retrieve all IP pools + + + +## ListIpPool + +> []IpPools200 ListIpPool(ctx, ) + +Retrieve all IP pools + +**This endpoint allows you to get all of your IP pools.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListIpPoolParams struct + + +### Return type + +[**[]IpPools200**](IpPools200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/ListRemainingIpCount.md b/rest/api/v3/ips/docs/ListRemainingIpCount.md new file mode 100644 index 00000000..f3df4a93 --- /dev/null +++ b/rest/api/v3/ips/docs/ListRemainingIpCount.md @@ -0,0 +1,44 @@ +# ListRemainingIpCount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListRemainingIpCount**](ListRemainingIpCount.md#ListRemainingIpCount) | **Get** /v3/ips/remaining | Get remaining IPs count + + + +## ListRemainingIpCount + +> ListRemainingIpCount200Response ListRemainingIpCount(ctx, ) + +Get remaining IPs count + +**This endpoint gets amount of IP Addresses that can still be created during a given period and the price of those IPs.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListRemainingIpCountParams struct + + +### Return type + +[**ListRemainingIpCount200Response**](ListRemainingIpCount200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/ListRemainingIpCount200Response.md b/rest/api/v3/ips/docs/ListRemainingIpCount200Response.md new file mode 100644 index 00000000..8496c11d --- /dev/null +++ b/rest/api/v3/ips/docs/ListRemainingIpCount200Response.md @@ -0,0 +1,11 @@ +# ListRemainingIpCount200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]ListRemainingIpCount200ResponseResultsInner**](ListRemainingIpCount200ResponseResultsInner.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/ListRemainingIpCount200ResponseResultsInner.md b/rest/api/v3/ips/docs/ListRemainingIpCount200ResponseResultsInner.md new file mode 100644 index 00000000..2eddbb09 --- /dev/null +++ b/rest/api/v3/ips/docs/ListRemainingIpCount200ResponseResultsInner.md @@ -0,0 +1,13 @@ +# ListRemainingIpCount200ResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Remaining** | **int32** | The number of IPs that can still be added to the user. | +**Period** | **string** | The length of time until user can add more IPs. | +**PricePerIp** | **float32** | The current cost to add an IP. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/SortByDirection.md b/rest/api/v3/ips/docs/SortByDirection.md new file mode 100644 index 00000000..0431e9a0 --- /dev/null +++ b/rest/api/v3/ips/docs/SortByDirection.md @@ -0,0 +1,13 @@ +# SortByDirection + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DESC** | string | (value: `"desc"`) +**ASC** | string | (value: `"asc"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/UpdateIpPool.md b/rest/api/v3/ips/docs/UpdateIpPool.md new file mode 100644 index 00000000..8f766155 --- /dev/null +++ b/rest/api/v3/ips/docs/UpdateIpPool.md @@ -0,0 +1,52 @@ +# UpdateIpPool + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateIpPool**](UpdateIpPool.md#UpdateIpPool) | **Put** /v3/ips/pools/{PoolName} | Rename an IP pool + + + +## UpdateIpPool + +> IpPools200 UpdateIpPool(ctx, PoolNameoptional) + +Rename an IP pool + +**This endpoint allows you to update the name of an IP pool.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**PoolName** | **string** | The name of the IP pool that you want to retrieve the IP addresses for. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateIpPoolParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateIpPoolRequest** | [**UpdateIpPoolRequest**](UpdateIpPoolRequest.md) | + +### Return type + +[**IpPools200**](IpPools200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/ips/docs/UpdateIpPool404Response.md b/rest/api/v3/ips/docs/UpdateIpPool404Response.md new file mode 100644 index 00000000..e3c5d6d7 --- /dev/null +++ b/rest/api/v3/ips/docs/UpdateIpPool404Response.md @@ -0,0 +1,11 @@ +# UpdateIpPool404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]UpdateIpPool404ResponseErrorsInner**](UpdateIpPool404ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/UpdateIpPool404ResponseErrorsInner.md b/rest/api/v3/ips/docs/UpdateIpPool404ResponseErrorsInner.md new file mode 100644 index 00000000..58d029a9 --- /dev/null +++ b/rest/api/v3/ips/docs/UpdateIpPool404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# UpdateIpPool404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | |[optional] +**Message** | **string** | A message explaining why the name of your IP pool could not be updated. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/docs/UpdateIpPoolRequest.md b/rest/api/v3/ips/docs/UpdateIpPoolRequest.md new file mode 100644 index 00000000..dff93b64 --- /dev/null +++ b/rest/api/v3/ips/docs/UpdateIpPoolRequest.md @@ -0,0 +1,11 @@ +# UpdateIpPoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The new name for your IP pool. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/ips/model_add_ip_201_response.go b/rest/api/v3/ips/model_add_ip_201_response.go new file mode 100644 index 00000000..ac46d11c --- /dev/null +++ b/rest/api/v3/ips/model_add_ip_201_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIp201Response struct for AddIp201Response +type AddIp201Response struct { + // List of IP objects. + Ips []AddIp201ResponseIpsInner `json:"ips"` + // The number of IPs that can still be added to the user. + RemainingIps int32 `json:"remaining_ips"` + // Whether or not the IPs are being warmed up. + Warmup bool `json:"warmup"` +} diff --git a/rest/api/v3/ips/model_add_ip_201_response_ips_inner.go b/rest/api/v3/ips/model_add_ip_201_response_ips_inner.go new file mode 100644 index 00000000..e69af04a --- /dev/null +++ b/rest/api/v3/ips/model_add_ip_201_response_ips_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIp201ResponseIpsInner struct for AddIp201ResponseIpsInner +type AddIp201ResponseIpsInner struct { + // IP added to account. + Ip string `json:"ip"` + // Array of usernames assigned a send IP. + Subusers []string `json:"subusers"` +} diff --git a/rest/api/v3/ips/model_add_ip_request.go b/rest/api/v3/ips/model_add_ip_request.go new file mode 100644 index 00000000..4a68e8ca --- /dev/null +++ b/rest/api/v3/ips/model_add_ip_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpRequest struct for AddIpRequest +type AddIpRequest struct { + // The amount of IPs to add to the account. + Count int32 `json:"count"` + // Array of usernames to be assigned a send IP. + Subusers *[]string `json:"subusers,omitempty"` + // Whether or not to warmup the IPs being added. + Warmup *bool `json:"warmup,omitempty"` +} diff --git a/rest/api/v3/ips/model_add_ip_to_ip_pool_201_response.go b/rest/api/v3/ips/model_add_ip_to_ip_pool_201_response.go new file mode 100644 index 00000000..dbbb205e --- /dev/null +++ b/rest/api/v3/ips/model_add_ip_to_ip_pool_201_response.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpToIpPool201Response struct for AddIpToIpPool201Response +type AddIpToIpPool201Response struct { + // The IP address. + Ip string `json:"ip"` + // The IP pools that this IP address has been added to. + Pools []string `json:"pools"` + // A Unix timestamp indicating when the warmup process began for the added IP address. + StartDate int32 `json:"start_date"` + // Indicates if the IP address is in warmup. + Warmup bool `json:"warmup"` +} diff --git a/rest/api/v3/ips/model_add_ip_to_ip_pool_404_response.go b/rest/api/v3/ips/model_add_ip_to_ip_pool_404_response.go new file mode 100644 index 00000000..a0333b44 --- /dev/null +++ b/rest/api/v3/ips/model_add_ip_to_ip_pool_404_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpToIpPool404Response struct for AddIpToIpPool404Response +type AddIpToIpPool404Response struct { + // The error returned. + Errors *[]AddIpToIpPool404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/ips/model_add_ip_to_ip_pool_404_response_errors_inner.go b/rest/api/v3/ips/model_add_ip_to_ip_pool_404_response_errors_inner.go new file mode 100644 index 00000000..eccc086a --- /dev/null +++ b/rest/api/v3/ips/model_add_ip_to_ip_pool_404_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpToIpPool404ResponseErrorsInner struct for AddIpToIpPool404ResponseErrorsInner +type AddIpToIpPool404ResponseErrorsInner struct { + Field *string `json:"field,omitempty"` + // A message explaining why the IP address could not be added to the IP Pool. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/ips/model_add_ip_to_ip_pool_request.go b/rest/api/v3/ips/model_add_ip_to_ip_pool_request.go new file mode 100644 index 00000000..4ab23abf --- /dev/null +++ b/rest/api/v3/ips/model_add_ip_to_ip_pool_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddIpToIpPoolRequest struct for AddIpToIpPoolRequest +type AddIpToIpPoolRequest struct { + // The IP address that you want to add to the named pool. + Ip *string `json:"ip,omitempty"` +} diff --git a/rest/api/v3/ips/model_create_ip_pool_request.go b/rest/api/v3/ips/model_create_ip_pool_request.go new file mode 100644 index 00000000..03bc175b --- /dev/null +++ b/rest/api/v3/ips/model_create_ip_pool_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateIpPoolRequest struct for CreateIpPoolRequest +type CreateIpPoolRequest struct { + // The name of your new IP pool. + Name string `json:"name"` +} diff --git a/rest/api/v3/ips/model_delete_ip_from_ip_pool_404_response.go b/rest/api/v3/ips/model_delete_ip_from_ip_pool_404_response.go new file mode 100644 index 00000000..c07d37d5 --- /dev/null +++ b/rest/api/v3/ips/model_delete_ip_from_ip_pool_404_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteIpFromIpPool404Response struct for DeleteIpFromIpPool404Response +type DeleteIpFromIpPool404Response struct { + // An error explaining why the IP address could not be removed from the IP pool. + Error *string `json:"error,omitempty"` +} diff --git a/rest/api/v3/ips/model_delete_ip_pool_404_response.go b/rest/api/v3/ips/model_delete_ip_pool_404_response.go new file mode 100644 index 00000000..e44f5d7a --- /dev/null +++ b/rest/api/v3/ips/model_delete_ip_pool_404_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteIpPool404Response struct for DeleteIpPool404Response +type DeleteIpPool404Response struct { + // An error explaining why the pool could not be deleted. + Error *string `json:"error,omitempty"` +} diff --git a/rest/api/v3/ips/model_error_response.go b/rest/api/v3/ips/model_error_response.go new file mode 100644 index 00000000..56fbd3ec --- /dev/null +++ b/rest/api/v3/ips/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/ips/model_error_response_errors_inner.go b/rest/api/v3/ips/model_error_response_errors_inner.go new file mode 100644 index 00000000..40c6b644 --- /dev/null +++ b/rest/api/v3/ips/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/ips/model_get_ip_200_response.go b/rest/api/v3/ips/model_get_ip_200_response.go new file mode 100644 index 00000000..e04eb406 --- /dev/null +++ b/rest/api/v3/ips/model_get_ip_200_response.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIp200Response struct for GetIp200Response +type GetIp200Response struct { + // The IP address. + Ip string `json:"ip"` + // The subusers that can send email using this IP address. + Subusers []string `json:"subusers"` + // The reverse DNS record for this IP address. + Rdns string `json:"rdns"` + // The list of IP pools that this IP address belongs to. + Pools []string `json:"pools"` + // Indicates if this IP address is currently warming up. + Warmup bool `json:"warmup"` + // The date that the IP address was entered into warmup. + StartDate int32 `json:"start_date"` + // Indicates if this IP address is associated with a reverse DNS record. + Whitelabeled bool `json:"whitelabeled"` +} diff --git a/rest/api/v3/ips/model_get_ip_pool_200_response.go b/rest/api/v3/ips/model_get_ip_pool_200_response.go new file mode 100644 index 00000000..e76d06e5 --- /dev/null +++ b/rest/api/v3/ips/model_get_ip_pool_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIpPool200Response struct for GetIpPool200Response +type GetIpPool200Response struct { + // The name of the IP pool. + PoolName *string `json:"pool_name,omitempty"` + // The IP addresses that belong to this pool. + Ips *[]string `json:"ips,omitempty"` +} diff --git a/rest/api/v3/ips/model_get_ip_pool_404_response.go b/rest/api/v3/ips/model_get_ip_pool_404_response.go new file mode 100644 index 00000000..d6bf3c53 --- /dev/null +++ b/rest/api/v3/ips/model_get_ip_pool_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIpPool404Response struct for GetIpPool404Response +type GetIpPool404Response struct { + Errors *[]GetIpPool404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/ips/model_get_ip_pool_404_response_errors_inner.go b/rest/api/v3/ips/model_get_ip_pool_404_response_errors_inner.go new file mode 100644 index 00000000..2478d7b8 --- /dev/null +++ b/rest/api/v3/ips/model_get_ip_pool_404_response_errors_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetIpPool404ResponseErrorsInner struct for GetIpPool404ResponseErrorsInner +type GetIpPool404ResponseErrorsInner struct { + // The name of the error. + Field *string `json:"field,omitempty"` + // A message explaining why the IP addresses could not be listed. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/ips/model_ip_pools200.go b/rest/api/v3/ips/model_ip_pools200.go new file mode 100644 index 00000000..5e4936fb --- /dev/null +++ b/rest/api/v3/ips/model_ip_pools200.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// IpPools200 struct for IpPools200 +type IpPools200 struct { + // The name of the IP pool. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/ips/model_list_assigned_ip_200_response_inner.go b/rest/api/v3/ips/model_list_assigned_ip_200_response_inner.go new file mode 100644 index 00000000..bdeb0205 --- /dev/null +++ b/rest/api/v3/ips/model_list_assigned_ip_200_response_inner.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAssignedIp200ResponseInner struct for ListAssignedIp200ResponseInner +type ListAssignedIp200ResponseInner struct { + // The IP address. + Ip string `json:"ip"` + // The IP pools that this IP address has been added to. + Pools []string `json:"pools"` + // Indicates if this IP address is currently warming up. + Warmup bool `json:"warmup"` + // The start date that this IP address was entered into warmup. + StartDate int32 `json:"start_date"` +} diff --git a/rest/api/v3/ips/model_list_ip_200_response_inner.go b/rest/api/v3/ips/model_list_ip_200_response_inner.go new file mode 100644 index 00000000..bed4a8f8 --- /dev/null +++ b/rest/api/v3/ips/model_list_ip_200_response_inner.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListIp200ResponseInner struct for ListIp200ResponseInner +type ListIp200ResponseInner struct { + // An IP address. + Ip string `json:"ip"` + // The subusers that are able to send email from this IP. + Subusers []string `json:"subusers"` + // The reverse DNS record for this IP address. + Rdns *string `json:"rdns,omitempty"` + // The IP pools that this IP has been added to. + Pools []string `json:"pools"` + // Indicates if this IP address is currently warming up. + Warmup bool `json:"warmup"` + // The date that the IP address was entered into warmup. + StartDate float32 `json:"start_date"` + // Indicates if this IP address is associated with a reverse DNS record. + Whitelabeled bool `json:"whitelabeled"` + // The date that the IP address was assigned to the user. + AssignedAt int32 `json:"assigned_at"` +} diff --git a/rest/api/v3/ips/model_list_remaining_ip_count_200_response.go b/rest/api/v3/ips/model_list_remaining_ip_count_200_response.go new file mode 100644 index 00000000..4bdd5881 --- /dev/null +++ b/rest/api/v3/ips/model_list_remaining_ip_count_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListRemainingIpCount200Response struct for ListRemainingIpCount200Response +type ListRemainingIpCount200Response struct { + Results []ListRemainingIpCount200ResponseResultsInner `json:"results"` +} diff --git a/rest/api/v3/ips/model_list_remaining_ip_count_200_response_results_inner.go b/rest/api/v3/ips/model_list_remaining_ip_count_200_response_results_inner.go new file mode 100644 index 00000000..ec67dd2f --- /dev/null +++ b/rest/api/v3/ips/model_list_remaining_ip_count_200_response_results_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListRemainingIpCount200ResponseResultsInner struct for ListRemainingIpCount200ResponseResultsInner +type ListRemainingIpCount200ResponseResultsInner struct { + // The number of IPs that can still be added to the user. + Remaining int32 `json:"remaining"` + // The length of time until user can add more IPs. + Period string `json:"period"` + // The current cost to add an IP. + PricePerIp float32 `json:"price_per_ip"` +} diff --git a/rest/api/v3/ips/model_sort_by_direction.go b/rest/api/v3/ips/model_sort_by_direction.go new file mode 100644 index 00000000..0e012a7d --- /dev/null +++ b/rest/api/v3/ips/model_sort_by_direction.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SortByDirection the model 'SortByDirection' +type SortByDirection string + +// List of SortByDirection +const ( + SORTBYDIRECTION_DESC SortByDirection = "desc" + SORTBYDIRECTION_ASC SortByDirection = "asc" +) diff --git a/rest/api/v3/ips/model_update_ip_pool_404_response.go b/rest/api/v3/ips/model_update_ip_pool_404_response.go new file mode 100644 index 00000000..9fca7b4c --- /dev/null +++ b/rest/api/v3/ips/model_update_ip_pool_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateIpPool404Response struct for UpdateIpPool404Response +type UpdateIpPool404Response struct { + Errors *[]UpdateIpPool404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/ips/model_update_ip_pool_404_response_errors_inner.go b/rest/api/v3/ips/model_update_ip_pool_404_response_errors_inner.go new file mode 100644 index 00000000..906137fd --- /dev/null +++ b/rest/api/v3/ips/model_update_ip_pool_404_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateIpPool404ResponseErrorsInner struct for UpdateIpPool404ResponseErrorsInner +type UpdateIpPool404ResponseErrorsInner struct { + Field *string `json:"field,omitempty"` + // A message explaining why the name of your IP pool could not be updated. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/ips/model_update_ip_pool_request.go b/rest/api/v3/ips/model_update_ip_pool_request.go new file mode 100644 index 00000000..766187d9 --- /dev/null +++ b/rest/api/v3/ips/model_update_ip_pool_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid IP Address API +* The Twilio SendGrid IP Address API allows you to add and manage dedicated IP addresses and IP Pools for your SendGrid account and Subusers. If you are sending any significant amount of email, SendGrid typically suggests sending from dedicated IPs. It's also best to send marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up IP Pools, which are groups of dedicated IP addresses you define to send particular types of messages. See the [**Dedicated IP Addresses**](https://docs.sendgrid.com/ui/account-and-settings/dedicated-ip-addresses) for more information about obtaining and allocating IPs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateIpPoolRequest struct for UpdateIpPoolRequest +type UpdateIpPoolRequest struct { + // The new name for your IP pool. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/link_branding/README.md b/rest/api/v3/link_branding/README.md new file mode 100644 index 00000000..9a652498 --- /dev/null +++ b/rest/api/v3/link_branding/README.md @@ -0,0 +1,98 @@ +# Go API client for + +The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. + +You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. + + See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.493812+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AssociateBrandedLinkWithSubuser* | [**AssociateBrandedLinkWithSubuser**](docs/AssociateBrandedLinkWithSubuser.md#associatebrandedlinkwithsubuser) | **Post** /v3/whitelabel/links/{LinkId}/subuser | Associate a branded link with a subuser +*CreateBrandedLink* | [**CreateBrandedLink**](docs/CreateBrandedLink.md#createbrandedlink) | **Post** /v3/whitelabel/links | Create a branded link +*DeleteBrandedLink* | [**DeleteBrandedLink**](docs/DeleteBrandedLink.md#deletebrandedlink) | **Delete** /v3/whitelabel/links/{Id} | Delete a branded link +*DisassociateBrandedLinkFromSubuser* | [**DisassociateBrandedLinkFromSubuser**](docs/DisassociateBrandedLinkFromSubuser.md#disassociatebrandedlinkfromsubuser) | **Delete** /v3/whitelabel/links/subuser | Disassociate a branded link from a subuser +*GetBrandedLink* | [**GetBrandedLink**](docs/GetBrandedLink.md#getbrandedlink) | **Get** /v3/whitelabel/links/{Id} | Retrieve a branded link +*ListBrandedLink* | [**ListBrandedLink**](docs/ListBrandedLink.md#listbrandedlink) | **Get** /v3/whitelabel/links | Retrieve all branded links +*ListDefaultBrandedLink* | [**ListDefaultBrandedLink**](docs/ListDefaultBrandedLink.md#listdefaultbrandedlink) | **Get** /v3/whitelabel/links/default | Retrieve the default branded link +*ListSubuserBrandedLink* | [**ListSubuserBrandedLink**](docs/ListSubuserBrandedLink.md#listsubuserbrandedlink) | **Get** /v3/whitelabel/links/subuser | Retrieve a subuser's branded link +*UpdateBrandedLink* | [**UpdateBrandedLink**](docs/UpdateBrandedLink.md#updatebrandedlink) | **Patch** /v3/whitelabel/links/{Id} | Update a branded link +*ValidateBrandedLink* | [**ValidateBrandedLink**](docs/ValidateBrandedLink.md#validatebrandedlink) | **Post** /v3/whitelabel/links/{Id}/validate | Validate a branded link + + +## Documentation For Models + + - [AssociateBrandedLinkWithSubuserRequest](AssociateBrandedLinkWithSubuserRequest.md) + - [CreateBrandedLinkRequest](CreateBrandedLinkRequest.md) + - [Default](Default.md) + - [Default1](Default1.md) + - [Default2](Default2.md) + - [Legacy](Legacy.md) + - [LinkBranding200](LinkBranding200.md) + - [LinkBranding200Dns](LinkBranding200Dns.md) + - [LinkBranding200DnsDomainCname](LinkBranding200DnsDomainCname.md) + - [LinkBranding200DnsOwnerCname](LinkBranding200DnsOwnerCname.md) + - [Region](Region.md) + - [Type](Type.md) + - [Type1](Type1.md) + - [UpdateBrandedLinkRequest](UpdateBrandedLinkRequest.md) + - [Valid](Valid.md) + - [Valid1](Valid1.md) + - [Valid2](Valid2.md) + - [Valid3](Valid3.md) + - [Valid4](Valid4.md) + - [Valid5](Valid5.md) + - [ValidateBrandedLink200Response](ValidateBrandedLink200Response.md) + - [ValidateBrandedLink200ResponseValidationResults](ValidateBrandedLink200ResponseValidationResults.md) + - [ValidateBrandedLink200ResponseValidationResultsDomainCname](ValidateBrandedLink200ResponseValidationResultsDomainCname.md) + - [ValidateBrandedLink200ResponseValidationResultsOwnerCname](ValidateBrandedLink200ResponseValidationResultsOwnerCname.md) + - [ValidateBrandedLink500Response](ValidateBrandedLink500Response.md) + - [ValidateBrandedLink500ResponseErrorsInner](ValidateBrandedLink500ResponseErrorsInner.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/link_branding/api_associate_branded_link_with_subuser.go b/rest/api/v3/link_branding/api_associate_branded_link_with_subuser.go new file mode 100644 index 00000000..a591fa8d --- /dev/null +++ b/rest/api/v3/link_branding/api_associate_branded_link_with_subuser.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type AssociateBrandedLinkWithSubuserParam struct { + // The ID of the branded link you want to associate. + LinkId *int32 `json:"link_id"` + // + AssociateBrandedLinkWithSubuserRequest *AssociateBrandedLinkWithSubuserRequest `json:"AssociateBrandedLinkWithSubuserRequest,omitempty"` +} + +func (params *AssociateBrandedLinkWithSubuserParam) SetLinkId(LinkId int32) *AssociateBrandedLinkWithSubuserParam { + params.LinkId = &LinkId + return params +} +func (params *AssociateBrandedLinkWithSubuserParam) SetAssociateBrandedLinkWithSubuserRequest(AssociateBrandedLinkWithSubuserRequest AssociateBrandedLinkWithSubuserRequest) *AssociateBrandedLinkWithSubuserParam { + params.AssociateBrandedLinkWithSubuserRequest = &AssociateBrandedLinkWithSubuserRequest + return params +} + +// **This endpoint allows you to associate a branded link with a subuser account.** Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). +func (c *ApiService) AssociateBrandedLinkWithSubuser(params *AssociateBrandedLinkWithSubuserParam) (interface{}, error) { + path := "/v3/whitelabel/links/{LinkId}/subuser" + if params != nil && params.LinkId != nil { + path = strings.Replace(path, "{"+"LinkId"+"}", fmt.Sprint(*params.LinkId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AssociateBrandedLinkWithSubuserRequest != nil { + b, err := json.Marshal(*params.AssociateBrandedLinkWithSubuserRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &LinkBranding200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_create_branded_link.go b/rest/api/v3/link_branding/api_create_branded_link.go new file mode 100644 index 00000000..589fc3e6 --- /dev/null +++ b/rest/api/v3/link_branding/api_create_branded_link.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateBrandedLinkParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateBrandedLinkRequest *CreateBrandedLinkRequest `json:"CreateBrandedLinkRequest,omitempty"` +} + +func (params *CreateBrandedLinkParam) SetOnbehalfof(Onbehalfof string) *CreateBrandedLinkParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateBrandedLinkParam) SetCreateBrandedLinkRequest(CreateBrandedLinkRequest CreateBrandedLinkRequest) *CreateBrandedLinkParam { + params.CreateBrandedLinkRequest = &CreateBrandedLinkRequest + return params +} + +// **This endpoint allows you to create a new branded link.** To create the link branding, supply the root domain and, optionally, the subdomain — these go into separate fields in your request body. The root domain should match your FROM email address. If you provide a subdomain, it must be different from the subdomain you used for authenticating your domain. You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. +func (c *ApiService) CreateBrandedLink(params *CreateBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateBrandedLinkRequest != nil { + b, err := json.Marshal(*params.CreateBrandedLinkRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &LinkBranding200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_delete_branded_link.go b/rest/api/v3/link_branding/api_delete_branded_link.go new file mode 100644 index 00000000..e2828ad1 --- /dev/null +++ b/rest/api/v3/link_branding/api_delete_branded_link.go @@ -0,0 +1,71 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteBrandedLinkParam struct { + // The ID of the branded link you want to retrieve. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteBrandedLinkParam) SetId(Id int32) *DeleteBrandedLinkParam { + params.Id = &Id + return params +} +func (params *DeleteBrandedLinkParam) SetOnbehalfof(Onbehalfof string) *DeleteBrandedLinkParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a branded link.** Your request will receive a response with a 204 status code if the deletion was successful. The call does not return the link's details, so if you wish to record these make sure you call the \"Retrieve a branded link\" endpoint *before* you request its deletion. You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. +func (c *ApiService) DeleteBrandedLink(params *DeleteBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_disassociate_branded_link_from_subuser.go b/rest/api/v3/link_branding/api_disassociate_branded_link_from_subuser.go new file mode 100644 index 00000000..989ae8b5 --- /dev/null +++ b/rest/api/v3/link_branding/api_disassociate_branded_link_from_subuser.go @@ -0,0 +1,60 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type DisassociateBrandedLinkFromSubuserParam struct { + // The username of the subuser account that you want to disassociate a branded link from. + Username *string `json:"username"` +} + +func (params *DisassociateBrandedLinkFromSubuserParam) SetUsername(Username string) *DisassociateBrandedLinkFromSubuserParam { + params.Username = &Username + return params +} + +// **This endpoint allows you to take a branded link away from a subuser.** Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). Your request will receive a response with a 204 status code if the disassociation was successful. +func (c *ApiService) DisassociateBrandedLinkFromSubuser(params *DisassociateBrandedLinkFromSubuserParam) (interface{}, error) { + path := "/v3/whitelabel/links/subuser" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_get_branded_link.go b/rest/api/v3/link_branding/api_get_branded_link.go new file mode 100644 index 00000000..b9ea2c56 --- /dev/null +++ b/rest/api/v3/link_branding/api_get_branded_link.go @@ -0,0 +1,71 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetBrandedLinkParam struct { + // The ID of the branded link you want to retrieve. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetBrandedLinkParam) SetId(Id int32) *GetBrandedLinkParam { + params.Id = &Id + return params +} +func (params *GetBrandedLinkParam) SetOnbehalfof(Onbehalfof string) *GetBrandedLinkParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific branded link by providing its ID.** You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. +func (c *ApiService) GetBrandedLink(params *GetBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &LinkBranding200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_list_branded_link.go b/rest/api/v3/link_branding/api_list_branded_link.go new file mode 100644 index 00000000..3e20f45b --- /dev/null +++ b/rest/api/v3/link_branding/api_list_branded_link.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListBrandedLinkParam struct { + // Limits the number of results returned per page. + Limit *int32 `json:"limit,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListBrandedLinkParam) SetLimit(Limit int32) *ListBrandedLinkParam { + params.Limit = &Limit + return params +} +func (params *ListBrandedLinkParam) SetOnbehalfof(Onbehalfof string) *ListBrandedLinkParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all branded links**. You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. +func (c *ApiService) ListBrandedLink(params *ListBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]LinkBranding200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_list_default_branded_link.go b/rest/api/v3/link_branding/api_list_default_branded_link.go new file mode 100644 index 00000000..fe1d6d67 --- /dev/null +++ b/rest/api/v3/link_branding/api_list_default_branded_link.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListDefaultBrandedLinkParam struct { + // The domain to match against when finding the default branded link. + Domain *string `json:"domain,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListDefaultBrandedLinkParam) SetDomain(Domain string) *ListDefaultBrandedLinkParam { + params.Domain = &Domain + return params +} +func (params *ListDefaultBrandedLinkParam) SetOnbehalfof(Onbehalfof string) *ListDefaultBrandedLinkParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the default branded link.** The default branded link is the actual URL to be used when sending messages. If you have more than one branded link, the default is determined by the following order: * The validated branded link marked as `default` (set when you call the \"Create a branded link\" endpoint or by calling the \"Update a branded link\" endpoint on an existing link) * Legacy branded links (migrated from the whitelabel wizard) * Default SendGrid-branded links (i.e., `100.ct.sendgrid.net`) You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. +func (c *ApiService) ListDefaultBrandedLink(params *ListDefaultBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links/default" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Domain != nil { + data.Set("domain", *params.Domain) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &LinkBranding200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_list_subuser_branded_link.go b/rest/api/v3/link_branding/api_list_subuser_branded_link.go new file mode 100644 index 00000000..0e4a686d --- /dev/null +++ b/rest/api/v3/link_branding/api_list_subuser_branded_link.go @@ -0,0 +1,60 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListSubuserBrandedLinkParam struct { + // The username of the subuser to retrieve associated branded links for. + Username *string `json:"username"` +} + +func (params *ListSubuserBrandedLinkParam) SetUsername(Username string) *ListSubuserBrandedLinkParam { + params.Username = &Username + return params +} + +// **This endpoint allows you to retrieve the branded link associated with a subuser.** Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and then validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). +func (c *ApiService) ListSubuserBrandedLink(params *ListSubuserBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links/subuser" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &LinkBranding200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_service.go b/rest/api/v3/link_branding/api_service.go new file mode 100644 index 00000000..53680fb0 --- /dev/null +++ b/rest/api/v3/link_branding/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/link_branding/api_update_branded_link.go b/rest/api/v3/link_branding/api_update_branded_link.go new file mode 100644 index 00000000..454bb0f4 --- /dev/null +++ b/rest/api/v3/link_branding/api_update_branded_link.go @@ -0,0 +1,86 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateBrandedLinkParam struct { + // The ID of the branded link you want to retrieve. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateBrandedLinkRequest *UpdateBrandedLinkRequest `json:"UpdateBrandedLinkRequest,omitempty"` +} + +func (params *UpdateBrandedLinkParam) SetId(Id int32) *UpdateBrandedLinkParam { + params.Id = &Id + return params +} +func (params *UpdateBrandedLinkParam) SetOnbehalfof(Onbehalfof string) *UpdateBrandedLinkParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateBrandedLinkParam) SetUpdateBrandedLinkRequest(UpdateBrandedLinkRequest UpdateBrandedLinkRequest) *UpdateBrandedLinkParam { + params.UpdateBrandedLinkRequest = &UpdateBrandedLinkRequest + return params +} + +// **This endpoint allows you to update a specific branded link. You can use this endpoint to change a branded link's default status.** You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. +func (c *ApiService) UpdateBrandedLink(params *UpdateBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateBrandedLinkRequest != nil { + b, err := json.Marshal(*params.UpdateBrandedLinkRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &LinkBranding200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/api_validate_branded_link.go b/rest/api/v3/link_branding/api_validate_branded_link.go new file mode 100644 index 00000000..df9d7896 --- /dev/null +++ b/rest/api/v3/link_branding/api_validate_branded_link.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ValidateBrandedLinkParam struct { + // The ID of the branded link that you want to validate. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ValidateBrandedLinkParam) SetId(Id int32) *ValidateBrandedLinkParam { + params.Id = &Id + return params +} +func (params *ValidateBrandedLinkParam) SetOnbehalfof(Onbehalfof string) *ValidateBrandedLinkParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to validate a branded link.** You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. +func (c *ApiService) ValidateBrandedLink(params *ValidateBrandedLinkParam) (interface{}, error) { + path := "/v3/whitelabel/links/{Id}/validate" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ValidateBrandedLink200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ValidateBrandedLink500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuser.md b/rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuser.md new file mode 100644 index 00000000..f15454e0 --- /dev/null +++ b/rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuser.md @@ -0,0 +1,52 @@ +# AssociateBrandedLinkWithSubuser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AssociateBrandedLinkWithSubuser**](AssociateBrandedLinkWithSubuser.md#AssociateBrandedLinkWithSubuser) | **Post** /v3/whitelabel/links/{LinkId}/subuser | Associate a branded link with a subuser + + + +## AssociateBrandedLinkWithSubuser + +> LinkBranding200 AssociateBrandedLinkWithSubuser(ctx, LinkIdoptional) + +Associate a branded link with a subuser + +**This endpoint allows you to associate a branded link with a subuser account.** Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**LinkId** | **int32** | The ID of the branded link you want to associate. + +### Other Parameters + +Other parameters are passed through a pointer to a AssociateBrandedLinkWithSubuserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AssociateBrandedLinkWithSubuserRequest** | [**AssociateBrandedLinkWithSubuserRequest**](AssociateBrandedLinkWithSubuserRequest.md) | + +### Return type + +[**LinkBranding200**](LinkBranding200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuserRequest.md b/rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuserRequest.md new file mode 100644 index 00000000..09cd138a --- /dev/null +++ b/rest/api/v3/link_branding/docs/AssociateBrandedLinkWithSubuserRequest.md @@ -0,0 +1,11 @@ +# AssociateBrandedLinkWithSubuserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | The username of the subuser account that you want to associate the branded link with. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/CreateBrandedLink.md b/rest/api/v3/link_branding/docs/CreateBrandedLink.md new file mode 100644 index 00000000..46b12fea --- /dev/null +++ b/rest/api/v3/link_branding/docs/CreateBrandedLink.md @@ -0,0 +1,49 @@ +# CreateBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateBrandedLink**](CreateBrandedLink.md#CreateBrandedLink) | **Post** /v3/whitelabel/links | Create a branded link + + + +## CreateBrandedLink + +> LinkBranding200 CreateBrandedLink(ctx, optional) + +Create a branded link + +**This endpoint allows you to create a new branded link.** To create the link branding, supply the root domain and, optionally, the subdomain — these go into separate fields in your request body. The root domain should match your FROM email address. If you provide a subdomain, it must be different from the subdomain you used for authenticating your domain. You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateBrandedLinkRequest** | [**CreateBrandedLinkRequest**](CreateBrandedLinkRequest.md) | + +### Return type + +[**LinkBranding200**](LinkBranding200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/CreateBrandedLinkRequest.md b/rest/api/v3/link_branding/docs/CreateBrandedLinkRequest.md new file mode 100644 index 00000000..1f9c4806 --- /dev/null +++ b/rest/api/v3/link_branding/docs/CreateBrandedLinkRequest.md @@ -0,0 +1,14 @@ +# CreateBrandedLinkRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Domain** | **string** | The root domain for the subdomain that you are creating the link branding for. This should match your FROM email address. | +**Subdomain** | **string** | The subdomain to create the link branding for. Must be different from the subdomain you used for authenticating your domain. |[optional] +**Default** | [**Default**](Default.md) | Indicates if you want to use this link branding as the default or fallback. When setting a new default, the existing default link branding will have its default status removed automatically. |[optional] +**Region** | [**Region**](Region.md) | The region of the IP address. Can be `eu` or `us`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Default.md b/rest/api/v3/link_branding/docs/Default.md new file mode 100644 index 00000000..d28299bf --- /dev/null +++ b/rest/api/v3/link_branding/docs/Default.md @@ -0,0 +1,13 @@ +# Default + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Default1.md b/rest/api/v3/link_branding/docs/Default1.md new file mode 100644 index 00000000..5c6f9287 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Default1.md @@ -0,0 +1,13 @@ +# Default1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Default2.md b/rest/api/v3/link_branding/docs/Default2.md new file mode 100644 index 00000000..41b408e4 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Default2.md @@ -0,0 +1,13 @@ +# Default2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/DeleteBrandedLink.md b/rest/api/v3/link_branding/docs/DeleteBrandedLink.md new file mode 100644 index 00000000..994d7546 --- /dev/null +++ b/rest/api/v3/link_branding/docs/DeleteBrandedLink.md @@ -0,0 +1,52 @@ +# DeleteBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteBrandedLink**](DeleteBrandedLink.md#DeleteBrandedLink) | **Delete** /v3/whitelabel/links/{Id} | Delete a branded link + + + +## DeleteBrandedLink + +> map[string]interface{} DeleteBrandedLink(ctx, Idoptional) + +Delete a branded link + +**This endpoint allows you to delete a branded link.** Your request will receive a response with a 204 status code if the deletion was successful. The call does not return the link's details, so if you wish to record these make sure you call the \"Retrieve a branded link\" endpoint *before* you request its deletion. You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The ID of the branded link you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/DisassociateBrandedLinkFromSubuser.md b/rest/api/v3/link_branding/docs/DisassociateBrandedLinkFromSubuser.md new file mode 100644 index 00000000..2ec6eb15 --- /dev/null +++ b/rest/api/v3/link_branding/docs/DisassociateBrandedLinkFromSubuser.md @@ -0,0 +1,47 @@ +# DisassociateBrandedLinkFromSubuser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DisassociateBrandedLinkFromSubuser**](DisassociateBrandedLinkFromSubuser.md#DisassociateBrandedLinkFromSubuser) | **Delete** /v3/whitelabel/links/subuser | Disassociate a branded link from a subuser + + + +## DisassociateBrandedLinkFromSubuser + +> map[string]interface{} DisassociateBrandedLinkFromSubuser(ctx, Username) + +Disassociate a branded link from a subuser + +**This endpoint allows you to take a branded link away from a subuser.** Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). Your request will receive a response with a 204 status code if the disassociation was successful. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a DisassociateBrandedLinkFromSubuserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/GetBrandedLink.md b/rest/api/v3/link_branding/docs/GetBrandedLink.md new file mode 100644 index 00000000..ae77aa26 --- /dev/null +++ b/rest/api/v3/link_branding/docs/GetBrandedLink.md @@ -0,0 +1,52 @@ +# GetBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetBrandedLink**](GetBrandedLink.md#GetBrandedLink) | **Get** /v3/whitelabel/links/{Id} | Retrieve a branded link + + + +## GetBrandedLink + +> LinkBranding200 GetBrandedLink(ctx, Idoptional) + +Retrieve a branded link + +**This endpoint allows you to retrieve a specific branded link by providing its ID.** You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The ID of the branded link you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**LinkBranding200**](LinkBranding200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/Legacy.md b/rest/api/v3/link_branding/docs/Legacy.md new file mode 100644 index 00000000..fb166798 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Legacy.md @@ -0,0 +1,13 @@ +# Legacy + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/LinkBranding200.md b/rest/api/v3/link_branding/docs/LinkBranding200.md new file mode 100644 index 00000000..1993e342 --- /dev/null +++ b/rest/api/v3/link_branding/docs/LinkBranding200.md @@ -0,0 +1,19 @@ +# LinkBranding200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the branded link. | +**Domain** | **string** | The root domain of the branded link. | +**Subdomain** | **string** | The subdomain used to generate the DNS records for this link branding. This subdomain must be different from the subdomain used for your authenticated domain. |[optional] +**Username** | **string** | The username of the account that this link branding is associated with. | +**UserId** | **int32** | The ID of the user that this link branding is associated with. | +**Default** | [**Default2**](Default2.md) | Indicates if this is the default link branding. | +**Valid** | [**Valid3**](Valid3.md) | Indicates if this link branding is valid. | +**Legacy** | [**Legacy**](Legacy.md) | Indicates if this link branding was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create new link branding if you need to update it. | +**Dns** | [**LinkBranding200Dns**](LinkBranding200Dns.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/LinkBranding200Dns.md b/rest/api/v3/link_branding/docs/LinkBranding200Dns.md new file mode 100644 index 00000000..48e06ca8 --- /dev/null +++ b/rest/api/v3/link_branding/docs/LinkBranding200Dns.md @@ -0,0 +1,12 @@ +# LinkBranding200Dns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DomainCname** | [**LinkBranding200DnsDomainCname**](LinkBranding200DnsDomainCname.md) | | +**OwnerCname** | [**LinkBranding200DnsOwnerCname**](LinkBranding200DnsOwnerCname.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/LinkBranding200DnsDomainCname.md b/rest/api/v3/link_branding/docs/LinkBranding200DnsDomainCname.md new file mode 100644 index 00000000..4642dbe5 --- /dev/null +++ b/rest/api/v3/link_branding/docs/LinkBranding200DnsDomainCname.md @@ -0,0 +1,14 @@ +# LinkBranding200DnsDomainCname + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | [**Valid4**](Valid4.md) | Indicates if the DNS record is valid. | +**Type** | [**Type**](Type.md) | The type of DNS record that was generated. | +**Host** | **string** | The domain that this link branding will use for the links in your email. | +**Data** | **string** | The domain that the DNS record points to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/LinkBranding200DnsOwnerCname.md b/rest/api/v3/link_branding/docs/LinkBranding200DnsOwnerCname.md new file mode 100644 index 00000000..d87102cd --- /dev/null +++ b/rest/api/v3/link_branding/docs/LinkBranding200DnsOwnerCname.md @@ -0,0 +1,14 @@ +# LinkBranding200DnsOwnerCname + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | [**Valid5**](Valid5.md) | Indicates if the DNS record is valid. | +**Type** | [**Type1**](Type1.md) | The type of DNS record generated. |[optional] +**Host** | **string** | Used to verify the link branding. The subdomain of this domain is the ID of the user who created the link branding. | +**Data** | **string** | The domain that the DNS record points to. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/ListBrandedLink.md b/rest/api/v3/link_branding/docs/ListBrandedLink.md new file mode 100644 index 00000000..c9b5a627 --- /dev/null +++ b/rest/api/v3/link_branding/docs/ListBrandedLink.md @@ -0,0 +1,49 @@ +# ListBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListBrandedLink**](ListBrandedLink.md#ListBrandedLink) | **Get** /v3/whitelabel/links | Retrieve all branded links + + + +## ListBrandedLink + +> []LinkBranding200 ListBrandedLink(ctx, optional) + +Retrieve all branded links + +**This endpoint allows you to retrieve all branded links**. You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | Limits the number of results returned per page. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]LinkBranding200**](LinkBranding200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/ListDefaultBrandedLink.md b/rest/api/v3/link_branding/docs/ListDefaultBrandedLink.md new file mode 100644 index 00000000..b8360084 --- /dev/null +++ b/rest/api/v3/link_branding/docs/ListDefaultBrandedLink.md @@ -0,0 +1,49 @@ +# ListDefaultBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListDefaultBrandedLink**](ListDefaultBrandedLink.md#ListDefaultBrandedLink) | **Get** /v3/whitelabel/links/default | Retrieve the default branded link + + + +## ListDefaultBrandedLink + +> LinkBranding200 ListDefaultBrandedLink(ctx, optional) + +Retrieve the default branded link + +**This endpoint allows you to retrieve the default branded link.** The default branded link is the actual URL to be used when sending messages. If you have more than one branded link, the default is determined by the following order: * The validated branded link marked as `default` (set when you call the \"Create a branded link\" endpoint or by calling the \"Update a branded link\" endpoint on an existing link) * Legacy branded links (migrated from the whitelabel wizard) * Default SendGrid-branded links (i.e., `100.ct.sendgrid.net`) You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListDefaultBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Domain** | **string** | The domain to match against when finding the default branded link. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**LinkBranding200**](LinkBranding200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/ListSubuserBrandedLink.md b/rest/api/v3/link_branding/docs/ListSubuserBrandedLink.md new file mode 100644 index 00000000..5ac2695b --- /dev/null +++ b/rest/api/v3/link_branding/docs/ListSubuserBrandedLink.md @@ -0,0 +1,47 @@ +# ListSubuserBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSubuserBrandedLink**](ListSubuserBrandedLink.md#ListSubuserBrandedLink) | **Get** /v3/whitelabel/links/subuser | Retrieve a subuser's branded link + + + +## ListSubuserBrandedLink + +> LinkBranding200 ListSubuserBrandedLink(ctx, Username) + +Retrieve a subuser's branded link + +**This endpoint allows you to retrieve the branded link associated with a subuser.** Link branding can be associated with subusers from the parent account. This functionality allows subusers to send mail using their parent's link branding. To associate link branding, the parent account must first create a branded link and then validate it. The parent may then associate that branded link with a subuser via the API or the [Subuser Management page of the Twilio SendGrid App](https://app.sendgrid.com/settings/subusers). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSubuserBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**LinkBranding200**](LinkBranding200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/Region.md b/rest/api/v3/link_branding/docs/Region.md new file mode 100644 index 00000000..e861b3d5 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Region.md @@ -0,0 +1,13 @@ +# Region + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EU** | string | (value: `"eu"`) +**US** | string | (value: `"us"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Type.md b/rest/api/v3/link_branding/docs/Type.md new file mode 100644 index 00000000..a510350e --- /dev/null +++ b/rest/api/v3/link_branding/docs/Type.md @@ -0,0 +1,14 @@ +# Type + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CNAME** | string | (value: `"cname"`) +**TXT** | string | (value: `"txt"`) +**MX** | string | (value: `"mx"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Type1.md b/rest/api/v3/link_branding/docs/Type1.md new file mode 100644 index 00000000..5534cbae --- /dev/null +++ b/rest/api/v3/link_branding/docs/Type1.md @@ -0,0 +1,14 @@ +# Type1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CNAME** | string | (value: `"cname"`) +**TXT** | string | (value: `"txt"`) +**MX** | string | (value: `"mx"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/UpdateBrandedLink.md b/rest/api/v3/link_branding/docs/UpdateBrandedLink.md new file mode 100644 index 00000000..c86f728b --- /dev/null +++ b/rest/api/v3/link_branding/docs/UpdateBrandedLink.md @@ -0,0 +1,53 @@ +# UpdateBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateBrandedLink**](UpdateBrandedLink.md#UpdateBrandedLink) | **Patch** /v3/whitelabel/links/{Id} | Update a branded link + + + +## UpdateBrandedLink + +> LinkBranding200 UpdateBrandedLink(ctx, Idoptional) + +Update a branded link + +**This endpoint allows you to update a specific branded link. You can use this endpoint to change a branded link's default status.** You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The ID of the branded link you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateBrandedLinkRequest** | [**UpdateBrandedLinkRequest**](UpdateBrandedLinkRequest.md) | + +### Return type + +[**LinkBranding200**](LinkBranding200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/UpdateBrandedLinkRequest.md b/rest/api/v3/link_branding/docs/UpdateBrandedLinkRequest.md new file mode 100644 index 00000000..2072273a --- /dev/null +++ b/rest/api/v3/link_branding/docs/UpdateBrandedLinkRequest.md @@ -0,0 +1,11 @@ +# UpdateBrandedLinkRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Default** | [**Default1**](Default1.md) | Indicates if the branded link is set as the default. When setting a new default, the existing default link branding will have its default status removed automatically. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Valid.md b/rest/api/v3/link_branding/docs/Valid.md new file mode 100644 index 00000000..2addd0e7 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Valid.md @@ -0,0 +1,13 @@ +# Valid + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Valid1.md b/rest/api/v3/link_branding/docs/Valid1.md new file mode 100644 index 00000000..bca4d56b --- /dev/null +++ b/rest/api/v3/link_branding/docs/Valid1.md @@ -0,0 +1,13 @@ +# Valid1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Valid2.md b/rest/api/v3/link_branding/docs/Valid2.md new file mode 100644 index 00000000..3abe1153 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Valid2.md @@ -0,0 +1,13 @@ +# Valid2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Valid3.md b/rest/api/v3/link_branding/docs/Valid3.md new file mode 100644 index 00000000..dfdefa92 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Valid3.md @@ -0,0 +1,13 @@ +# Valid3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Valid4.md b/rest/api/v3/link_branding/docs/Valid4.md new file mode 100644 index 00000000..e088e125 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Valid4.md @@ -0,0 +1,13 @@ +# Valid4 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/Valid5.md b/rest/api/v3/link_branding/docs/Valid5.md new file mode 100644 index 00000000..a3efe196 --- /dev/null +++ b/rest/api/v3/link_branding/docs/Valid5.md @@ -0,0 +1,13 @@ +# Valid5 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/ValidateBrandedLink.md b/rest/api/v3/link_branding/docs/ValidateBrandedLink.md new file mode 100644 index 00000000..98ebba01 --- /dev/null +++ b/rest/api/v3/link_branding/docs/ValidateBrandedLink.md @@ -0,0 +1,52 @@ +# ValidateBrandedLink + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ValidateBrandedLink**](ValidateBrandedLink.md#ValidateBrandedLink) | **Post** /v3/whitelabel/links/{Id}/validate | Validate a branded link + + + +## ValidateBrandedLink + +> ValidateBrandedLink200Response ValidateBrandedLink(ctx, Idoptional) + +Validate a branded link + +**This endpoint allows you to validate a branded link.** You can submit this request as one of your subusers if you include their ID in the `on-behalf-of` header in the request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The ID of the branded link that you want to validate. + +### Other Parameters + +Other parameters are passed through a pointer to a ValidateBrandedLinkParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ValidateBrandedLink200Response**](ValidateBrandedLink200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/link_branding/docs/ValidateBrandedLink200Response.md b/rest/api/v3/link_branding/docs/ValidateBrandedLink200Response.md new file mode 100644 index 00000000..b90b62ad --- /dev/null +++ b/rest/api/v3/link_branding/docs/ValidateBrandedLink200Response.md @@ -0,0 +1,13 @@ +# ValidateBrandedLink200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the branded link. | +**Valid** | [**Valid**](Valid.md) | Indicates if the link branding is valid. | +**ValidationResults** | [**ValidateBrandedLink200ResponseValidationResults**](ValidateBrandedLink200ResponseValidationResults.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResults.md b/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResults.md new file mode 100644 index 00000000..a1fba585 --- /dev/null +++ b/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResults.md @@ -0,0 +1,12 @@ +# ValidateBrandedLink200ResponseValidationResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DomainCname** | [**ValidateBrandedLink200ResponseValidationResultsDomainCname**](ValidateBrandedLink200ResponseValidationResultsDomainCname.md) | | +**OwnerCname** | [**ValidateBrandedLink200ResponseValidationResultsOwnerCname**](ValidateBrandedLink200ResponseValidationResultsOwnerCname.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsDomainCname.md b/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsDomainCname.md new file mode 100644 index 00000000..25e06af9 --- /dev/null +++ b/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsDomainCname.md @@ -0,0 +1,12 @@ +# ValidateBrandedLink200ResponseValidationResultsDomainCname + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | [**Valid1**](Valid1.md) | Indicates if this DNS record is valid. | +**Reason** | **string** | Null if the DNS record is valid. If the DNS record is invalid, this will explain why. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsOwnerCname.md b/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsOwnerCname.md new file mode 100644 index 00000000..b9514012 --- /dev/null +++ b/rest/api/v3/link_branding/docs/ValidateBrandedLink200ResponseValidationResultsOwnerCname.md @@ -0,0 +1,12 @@ +# ValidateBrandedLink200ResponseValidationResultsOwnerCname + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | [**Valid2**](Valid2.md) | Indicates if the DNS record is valid. | +**Reason** | **string** | Null if valid. If the DNS record is invalid, this will explain why. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/ValidateBrandedLink500Response.md b/rest/api/v3/link_branding/docs/ValidateBrandedLink500Response.md new file mode 100644 index 00000000..53528b60 --- /dev/null +++ b/rest/api/v3/link_branding/docs/ValidateBrandedLink500Response.md @@ -0,0 +1,11 @@ +# ValidateBrandedLink500Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ValidateBrandedLink500ResponseErrorsInner**](ValidateBrandedLink500ResponseErrorsInner.md) | The reasons why the validation failed. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/docs/ValidateBrandedLink500ResponseErrorsInner.md b/rest/api/v3/link_branding/docs/ValidateBrandedLink500ResponseErrorsInner.md new file mode 100644 index 00000000..1e8880fd --- /dev/null +++ b/rest/api/v3/link_branding/docs/ValidateBrandedLink500ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# ValidateBrandedLink500ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The reason why the link whitelabel could not be validated. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/link_branding/model_associate_branded_link_with_subuser_request.go b/rest/api/v3/link_branding/model_associate_branded_link_with_subuser_request.go new file mode 100644 index 00000000..58038420 --- /dev/null +++ b/rest/api/v3/link_branding/model_associate_branded_link_with_subuser_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AssociateBrandedLinkWithSubuserRequest struct for AssociateBrandedLinkWithSubuserRequest +type AssociateBrandedLinkWithSubuserRequest struct { + // The username of the subuser account that you want to associate the branded link with. + Username *string `json:"username,omitempty"` +} diff --git a/rest/api/v3/link_branding/model_create_branded_link_request.go b/rest/api/v3/link_branding/model_create_branded_link_request.go new file mode 100644 index 00000000..7a72f580 --- /dev/null +++ b/rest/api/v3/link_branding/model_create_branded_link_request.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateBrandedLinkRequest struct for CreateBrandedLinkRequest +type CreateBrandedLinkRequest struct { + // The root domain for the subdomain that you are creating the link branding for. This should match your FROM email address. + Domain string `json:"domain"` + // The subdomain to create the link branding for. Must be different from the subdomain you used for authenticating your domain. + Subdomain *string `json:"subdomain,omitempty"` + // Indicates if you want to use this link branding as the default or fallback. When setting a new default, the existing default link branding will have its default status removed automatically. + Default *Default `json:"default,omitempty"` + // The region of the IP address. Can be `eu` or `us`. + Region *Region `json:"region,omitempty"` +} diff --git a/rest/api/v3/link_branding/model_default.go b/rest/api/v3/link_branding/model_default.go new file mode 100644 index 00000000..537e69bc --- /dev/null +++ b/rest/api/v3/link_branding/model_default.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Default the model 'Default' +type Default bool + +// List of Default +const ( + DEFAULT_TRUE Default = true + DEFAULT_FALSE Default = false +) diff --git a/rest/api/v3/link_branding/model_default1.go b/rest/api/v3/link_branding/model_default1.go new file mode 100644 index 00000000..eda59858 --- /dev/null +++ b/rest/api/v3/link_branding/model_default1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Default1 the model 'Default1' +type Default1 bool + +// List of Default1 +const ( + DEFAULT1_TRUE Default1 = true + DEFAULT1_FALSE Default1 = false +) diff --git a/rest/api/v3/link_branding/model_default2.go b/rest/api/v3/link_branding/model_default2.go new file mode 100644 index 00000000..e16aeccb --- /dev/null +++ b/rest/api/v3/link_branding/model_default2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Default2 the model 'Default2' +type Default2 bool + +// List of Default2 +const ( + DEFAULT2_TRUE Default2 = true + DEFAULT2_FALSE Default2 = false +) diff --git a/rest/api/v3/link_branding/model_legacy.go b/rest/api/v3/link_branding/model_legacy.go new file mode 100644 index 00000000..821b3360 --- /dev/null +++ b/rest/api/v3/link_branding/model_legacy.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Legacy the model 'Legacy' +type Legacy bool + +// List of Legacy +const ( + LEGACY_TRUE Legacy = true + LEGACY_FALSE Legacy = false +) diff --git a/rest/api/v3/link_branding/model_link_branding200.go b/rest/api/v3/link_branding/model_link_branding200.go new file mode 100644 index 00000000..ff249aa3 --- /dev/null +++ b/rest/api/v3/link_branding/model_link_branding200.go @@ -0,0 +1,35 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// LinkBranding200 struct for LinkBranding200 +type LinkBranding200 struct { + // The ID of the branded link. + Id int32 `json:"id"` + // The root domain of the branded link. + Domain string `json:"domain"` + // The subdomain used to generate the DNS records for this link branding. This subdomain must be different from the subdomain used for your authenticated domain. + Subdomain *string `json:"subdomain,omitempty"` + // The username of the account that this link branding is associated with. + Username string `json:"username"` + // The ID of the user that this link branding is associated with. + UserId int32 `json:"user_id"` + // Indicates if this is the default link branding. + Default Default2 `json:"default"` + // Indicates if this link branding is valid. + Valid Valid3 `json:"valid"` + // Indicates if this link branding was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create new link branding if you need to update it. + Legacy Legacy `json:"legacy"` + Dns LinkBranding200Dns `json:"dns"` +} diff --git a/rest/api/v3/link_branding/model_link_branding200_dns.go b/rest/api/v3/link_branding/model_link_branding200_dns.go new file mode 100644 index 00000000..6a3cd783 --- /dev/null +++ b/rest/api/v3/link_branding/model_link_branding200_dns.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// LinkBranding200Dns The DNS records generated for this link branding. +type LinkBranding200Dns struct { + DomainCname LinkBranding200DnsDomainCname `json:"domain_cname"` + OwnerCname *LinkBranding200DnsOwnerCname `json:"owner_cname,omitempty"` +} diff --git a/rest/api/v3/link_branding/model_link_branding200_dns_domain_cname.go b/rest/api/v3/link_branding/model_link_branding200_dns_domain_cname.go new file mode 100644 index 00000000..5a324f64 --- /dev/null +++ b/rest/api/v3/link_branding/model_link_branding200_dns_domain_cname.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// LinkBranding200DnsDomainCname The DNS record generated to point to your link branding subdomain. +type LinkBranding200DnsDomainCname struct { + // Indicates if the DNS record is valid. + Valid Valid4 `json:"valid"` + // The type of DNS record that was generated. + Type Type `json:"type"` + // The domain that this link branding will use for the links in your email. + Host string `json:"host"` + // The domain that the DNS record points to. + Data string `json:"data"` +} diff --git a/rest/api/v3/link_branding/model_link_branding200_dns_owner_cname.go b/rest/api/v3/link_branding/model_link_branding200_dns_owner_cname.go new file mode 100644 index 00000000..7f3f73c9 --- /dev/null +++ b/rest/api/v3/link_branding/model_link_branding200_dns_owner_cname.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// LinkBranding200DnsOwnerCname The DNS record generated to verify who created the link branding. +type LinkBranding200DnsOwnerCname struct { + // Indicates if the DNS record is valid. + Valid Valid5 `json:"valid"` + // The type of DNS record generated. + Type *Type1 `json:"type,omitempty"` + // Used to verify the link branding. The subdomain of this domain is the ID of the user who created the link branding. + Host string `json:"host"` + // The domain that the DNS record points to. + Data string `json:"data"` +} diff --git a/rest/api/v3/link_branding/model_region.go b/rest/api/v3/link_branding/model_region.go new file mode 100644 index 00000000..b3919cb6 --- /dev/null +++ b/rest/api/v3/link_branding/model_region.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region the model 'Region' +type Region string + +// List of Region +const ( + REGION_EU Region = "eu" + REGION_US Region = "us" +) diff --git a/rest/api/v3/link_branding/model_type.go b/rest/api/v3/link_branding/model_type.go new file mode 100644 index 00000000..81e166bf --- /dev/null +++ b/rest/api/v3/link_branding/model_type.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_CNAME Type = "cname" + TYPE_TXT Type = "txt" + TYPE_MX Type = "mx" +) diff --git a/rest/api/v3/link_branding/model_type1.go b/rest/api/v3/link_branding/model_type1.go new file mode 100644 index 00000000..bf73a4a5 --- /dev/null +++ b/rest/api/v3/link_branding/model_type1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type1 the model 'Type1' +type Type1 string + +// List of Type1 +const ( + TYPE1_CNAME Type1 = "cname" + TYPE1_TXT Type1 = "txt" + TYPE1_MX Type1 = "mx" +) diff --git a/rest/api/v3/link_branding/model_update_branded_link_request.go b/rest/api/v3/link_branding/model_update_branded_link_request.go new file mode 100644 index 00000000..8f050b3f --- /dev/null +++ b/rest/api/v3/link_branding/model_update_branded_link_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateBrandedLinkRequest struct for UpdateBrandedLinkRequest +type UpdateBrandedLinkRequest struct { + // Indicates if the branded link is set as the default. When setting a new default, the existing default link branding will have its default status removed automatically. + Default *Default1 `json:"default,omitempty"` +} diff --git a/rest/api/v3/link_branding/model_valid.go b/rest/api/v3/link_branding/model_valid.go new file mode 100644 index 00000000..6ff1130e --- /dev/null +++ b/rest/api/v3/link_branding/model_valid.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid the model 'Valid' +type Valid bool + +// List of Valid +const ( + VALID_TRUE Valid = true + VALID_FALSE Valid = false +) diff --git a/rest/api/v3/link_branding/model_valid1.go b/rest/api/v3/link_branding/model_valid1.go new file mode 100644 index 00000000..b0a10088 --- /dev/null +++ b/rest/api/v3/link_branding/model_valid1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid1 the model 'Valid1' +type Valid1 bool + +// List of Valid1 +const ( + VALID1_TRUE Valid1 = true + VALID1_FALSE Valid1 = false +) diff --git a/rest/api/v3/link_branding/model_valid2.go b/rest/api/v3/link_branding/model_valid2.go new file mode 100644 index 00000000..b5131fe2 --- /dev/null +++ b/rest/api/v3/link_branding/model_valid2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid2 the model 'Valid2' +type Valid2 bool + +// List of Valid2 +const ( + VALID2_TRUE Valid2 = true + VALID2_FALSE Valid2 = false +) diff --git a/rest/api/v3/link_branding/model_valid3.go b/rest/api/v3/link_branding/model_valid3.go new file mode 100644 index 00000000..5dcb4a84 --- /dev/null +++ b/rest/api/v3/link_branding/model_valid3.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid3 the model 'Valid3' +type Valid3 bool + +// List of Valid3 +const ( + VALID3_TRUE Valid3 = true + VALID3_FALSE Valid3 = false +) diff --git a/rest/api/v3/link_branding/model_valid4.go b/rest/api/v3/link_branding/model_valid4.go new file mode 100644 index 00000000..6f6bff20 --- /dev/null +++ b/rest/api/v3/link_branding/model_valid4.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid4 the model 'Valid4' +type Valid4 bool + +// List of Valid4 +const ( + VALID4_TRUE Valid4 = true + VALID4_FALSE Valid4 = false +) diff --git a/rest/api/v3/link_branding/model_valid5.go b/rest/api/v3/link_branding/model_valid5.go new file mode 100644 index 00000000..3edd72fb --- /dev/null +++ b/rest/api/v3/link_branding/model_valid5.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid5 the model 'Valid5' +type Valid5 bool + +// List of Valid5 +const ( + VALID5_TRUE Valid5 = true + VALID5_FALSE Valid5 = false +) diff --git a/rest/api/v3/link_branding/model_validate_branded_link_200_response.go b/rest/api/v3/link_branding/model_validate_branded_link_200_response.go new file mode 100644 index 00000000..260ce5cd --- /dev/null +++ b/rest/api/v3/link_branding/model_validate_branded_link_200_response.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateBrandedLink200Response struct for ValidateBrandedLink200Response +type ValidateBrandedLink200Response struct { + // The ID of the branded link. + Id int32 `json:"id"` + // Indicates if the link branding is valid. + Valid Valid `json:"valid"` + ValidationResults ValidateBrandedLink200ResponseValidationResults `json:"validation_results"` +} diff --git a/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results.go b/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results.go new file mode 100644 index 00000000..5d4035c4 --- /dev/null +++ b/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateBrandedLink200ResponseValidationResults The individual validation results for each of the DNS records associated with this branded link. +type ValidateBrandedLink200ResponseValidationResults struct { + DomainCname ValidateBrandedLink200ResponseValidationResultsDomainCname `json:"domain_cname"` + OwnerCname *ValidateBrandedLink200ResponseValidationResultsOwnerCname `json:"owner_cname,omitempty"` +} diff --git a/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_domain_cname.go b/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_domain_cname.go new file mode 100644 index 00000000..4abbea3a --- /dev/null +++ b/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_domain_cname.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateBrandedLink200ResponseValidationResultsDomainCname The DNS record generated for the sending domain used for this branded link. +type ValidateBrandedLink200ResponseValidationResultsDomainCname struct { + // Indicates if this DNS record is valid. + Valid Valid1 `json:"valid"` + // Null if the DNS record is valid. If the DNS record is invalid, this will explain why. + Reason string `json:"reason"` +} diff --git a/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_owner_cname.go b/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_owner_cname.go new file mode 100644 index 00000000..0ee10180 --- /dev/null +++ b/rest/api/v3/link_branding/model_validate_branded_link_200_response_validation_results_owner_cname.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateBrandedLink200ResponseValidationResultsOwnerCname The DNS record created to verify the branded link. +type ValidateBrandedLink200ResponseValidationResultsOwnerCname struct { + // Indicates if the DNS record is valid. + Valid Valid2 `json:"valid"` + // Null if valid. If the DNS record is invalid, this will explain why. + Reason string `json:"reason"` +} diff --git a/rest/api/v3/link_branding/model_validate_branded_link_500_response.go b/rest/api/v3/link_branding/model_validate_branded_link_500_response.go new file mode 100644 index 00000000..f0ddbfc0 --- /dev/null +++ b/rest/api/v3/link_branding/model_validate_branded_link_500_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateBrandedLink500Response struct for ValidateBrandedLink500Response +type ValidateBrandedLink500Response struct { + // The reasons why the validation failed. + Errors []ValidateBrandedLink500ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/link_branding/model_validate_branded_link_500_response_errors_inner.go b/rest/api/v3/link_branding/model_validate_branded_link_500_response_errors_inner.go new file mode 100644 index 00000000..d0d11fbc --- /dev/null +++ b/rest/api/v3/link_branding/model_validate_branded_link_500_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Link Branding API +* The Twilio SendGrid Link Branding API allows you to configure your domain settings so that all of the click-tracked links, opens, and images in your emails are served from your domain rather than `sendgrid.net`. Spam filters and recipient servers look at the links within emails to determine whether the email appear trustworthy. They use the reputation of the root domain to determine whether the links can be trusted. You can also manage Link Branding in the **Sender Authentication** section of the Twilio SendGrid application user interface. See [**How to Set Up Link Branding**](https: //sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateBrandedLink500ResponseErrorsInner struct for ValidateBrandedLink500ResponseErrorsInner +type ValidateBrandedLink500ResponseErrorsInner struct { + // The reason why the link whitelabel could not be validated. + Message string `json:"message"` +} diff --git a/rest/api/v3/lmc_campaigns/README.md b/rest/api/v3/lmc_campaigns/README.md new file mode 100644 index 00000000..214a012e --- /dev/null +++ b/rest/api/v3/lmc_campaigns/README.md @@ -0,0 +1,88 @@ +# Go API client for + +The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). + +See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.498878+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateCampaign* | [**CreateCampaign**](docs/CreateCampaign.md#createcampaign) | **Post** /v3/campaigns | Create a Campaign +*DeleteCampaign* | [**DeleteCampaign**](docs/DeleteCampaign.md#deletecampaign) | **Delete** /v3/campaigns/{CampaignId} | Delete a Campaign +*GetCampaign* | [**GetCampaign**](docs/GetCampaign.md#getcampaign) | **Get** /v3/campaigns/{CampaignId} | Retrieve a single campaign +*GetScheduledCampaign* | [**GetScheduledCampaign**](docs/GetScheduledCampaign.md#getscheduledcampaign) | **Get** /v3/campaigns/{CampaignId}/schedules | View Scheduled Time of a Campaign +*ListCampaign* | [**ListCampaign**](docs/ListCampaign.md#listcampaign) | **Get** /v3/campaigns | Retrieve all Campaigns +*ScheduleCampaign* | [**ScheduleCampaign**](docs/ScheduleCampaign.md#schedulecampaign) | **Post** /v3/campaigns/{CampaignId}/schedules | Schedule a Campaign +*SendCampaign* | [**SendCampaign**](docs/SendCampaign.md#sendcampaign) | **Post** /v3/campaigns/{CampaignId}/schedules/now | Send a Campaign +*SendTestCampaign* | [**SendTestCampaign**](docs/SendTestCampaign.md#sendtestcampaign) | **Post** /v3/campaigns/{CampaignId}/schedules/test | Send a Test Campaign +*UnScheduleCampaign* | [**UnScheduleCampaign**](docs/UnScheduleCampaign.md#unschedulecampaign) | **Delete** /v3/campaigns/{CampaignId}/schedules | Unschedule a Scheduled Campaign +*UpdateCampaign* | [**UpdateCampaign**](docs/UpdateCampaign.md#updatecampaign) | **Patch** /v3/campaigns/{CampaignId} | Update a Campaign +*UpdateScheduledCampaign* | [**UpdateScheduledCampaign**](docs/UpdateScheduledCampaign.md#updatescheduledcampaign) | **Patch** /v3/campaigns/{CampaignId}/schedules | Update a Scheduled Campaign + + +## Documentation For Models + + - [Campaigns2xx](Campaigns2xx.md) + - [Editor](Editor.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [GetCampaign200Response](GetCampaign200Response.md) + - [ListCampaign200Response](ListCampaign200Response.md) + - [PostCampaignsRequest](PostCampaignsRequest.md) + - [ScheduleACampaignRequest](ScheduleACampaignRequest.md) + - [ScheduleACampaignResponse](ScheduleACampaignResponse.md) + - [SendACampaignResponse](SendACampaignResponse.md) + - [SendATestCampaignRequest](SendATestCampaignRequest.md) + - [SendTestCampaignRequest](SendTestCampaignRequest.md) + - [Status](Status.md) + - [UpdateACampaignRequest](UpdateACampaignRequest.md) + - [UpdateAScheduledCampaignRequest](UpdateAScheduledCampaignRequest.md) + - [UpdateAScheduledCampaignResponse](UpdateAScheduledCampaignResponse.md) + - [ViewScheduledTimeOfACampaignResponse](ViewScheduledTimeOfACampaignResponse.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/lmc_campaigns/api_create_campaign.go b/rest/api/v3/lmc_campaigns/api_create_campaign.go new file mode 100644 index 00000000..1b96d7c3 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_create_campaign.go @@ -0,0 +1,90 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateCampaignParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + PostCampaignsRequest *PostCampaignsRequest `json:"PostCampaignsRequest,omitempty"` +} + +func (params *CreateCampaignParam) SetOnbehalfof(Onbehalfof string) *CreateCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateCampaignParam) SetPostCampaignsRequest(PostCampaignsRequest PostCampaignsRequest) *CreateCampaignParam { + params.PostCampaignsRequest = &PostCampaignsRequest + return params +} + +// **This endpoint allows you to create a campaign.** In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign. +func (c *ApiService) CreateCampaign(params *CreateCampaignParam) (interface{}, error) { + path := "/v3/campaigns" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.PostCampaignsRequest != nil { + b, err := json.Marshal(*params.PostCampaignsRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &Campaigns2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_delete_campaign.go b/rest/api/v3/lmc_campaigns/api_delete_campaign.go new file mode 100644 index 00000000..7224c1b0 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_delete_campaign.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteCampaignParam struct { + // The id of the campaign you would like to retrieve. + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteCampaignParam) SetCampaignId(CampaignId int32) *DeleteCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *DeleteCampaignParam) SetOnbehalfof(Onbehalfof string) *DeleteCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a specific campaign.** +func (c *ApiService) DeleteCampaign(params *DeleteCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 401 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_get_campaign.go b/rest/api/v3/lmc_campaigns/api_get_campaign.go new file mode 100644 index 00000000..a1fcf38b --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_get_campaign.go @@ -0,0 +1,87 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetCampaignParam struct { + // The id of the campaign you would like to retrieve. + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetCampaignParam) SetCampaignId(CampaignId int32) *GetCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *GetCampaignParam) SetOnbehalfof(Onbehalfof string) *GetCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific campaign.** +func (c *ApiService) GetCampaign(params *GetCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetCampaign200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_get_scheduled_campaign.go b/rest/api/v3/lmc_campaigns/api_get_scheduled_campaign.go new file mode 100644 index 00000000..731ccec7 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_get_scheduled_campaign.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetScheduledCampaignParam struct { + // + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetScheduledCampaignParam) SetCampaignId(CampaignId int32) *GetScheduledCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *GetScheduledCampaignParam) SetOnbehalfof(Onbehalfof string) *GetScheduledCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the date and time that a campaign has been scheduled to be sent.** +func (c *ApiService) GetScheduledCampaign(params *GetScheduledCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}/schedules" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ViewScheduledTimeOfACampaignResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_list_campaign.go b/rest/api/v3/lmc_campaigns/api_list_campaign.go new file mode 100644 index 00000000..29b304e1 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_list_campaign.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListCampaignParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCampaignParam) SetLimit(Limit int32) *ListCampaignParam { + params.Limit = &Limit + return params +} +func (params *ListCampaignParam) SetOffset(Offset int32) *ListCampaignParam { + params.Offset = &Offset + return params +} +func (params *ListCampaignParam) SetOnbehalfof(Onbehalfof string) *ListCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all of your campaigns.** Returns campaigns in reverse order they were created (newest first). Returns an empty array if no campaigns exist. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListCampaign(params *ListCampaignParam) (interface{}, error) { + path := "/v3/campaigns" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListCampaign200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_schedule_campaign.go b/rest/api/v3/lmc_campaigns/api_schedule_campaign.go new file mode 100644 index 00000000..1394c148 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_schedule_campaign.go @@ -0,0 +1,118 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ScheduleCampaignParam struct { + // + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + ScheduleACampaignRequest *ScheduleACampaignRequest `json:"ScheduleACampaignRequest,omitempty"` +} + +func (params *ScheduleCampaignParam) SetCampaignId(CampaignId int32) *ScheduleCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *ScheduleCampaignParam) SetOnbehalfof(Onbehalfof string) *ScheduleCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ScheduleCampaignParam) SetScheduleACampaignRequest(ScheduleACampaignRequest ScheduleACampaignRequest) *ScheduleCampaignParam { + params.ScheduleACampaignRequest = &ScheduleACampaignRequest + return params +} + +// **This endpoint allows you to schedule a specific date and time for your campaign to be sent.** If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won't be going through our servers at the same times as everyone else's mail. +func (c *ApiService) ScheduleCampaign(params *ScheduleCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}/schedules" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.ScheduleACampaignRequest != nil { + b, err := json.Marshal(*params.ScheduleACampaignRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ScheduleACampaignResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_send_campaign.go b/rest/api/v3/lmc_campaigns/api_send_campaign.go new file mode 100644 index 00000000..8b65c436 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_send_campaign.go @@ -0,0 +1,103 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type SendCampaignParam struct { + // + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *SendCampaignParam) SetCampaignId(CampaignId int32) *SendCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *SendCampaignParam) SetOnbehalfof(Onbehalfof string) *SendCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to immediately send an existing campaign.** Normally a POST request would have a body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed. +func (c *ApiService) SendCampaign(params *SendCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}/schedules/now" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &SendACampaignResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_send_test_campaign.go b/rest/api/v3/lmc_campaigns/api_send_test_campaign.go new file mode 100644 index 00000000..6c48dcf0 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_send_test_campaign.go @@ -0,0 +1,102 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type SendTestCampaignParam struct { + // + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + SendTestCampaignRequest *SendTestCampaignRequest `json:"SendTestCampaignRequest,omitempty"` +} + +func (params *SendTestCampaignParam) SetCampaignId(CampaignId int32) *SendTestCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *SendTestCampaignParam) SetOnbehalfof(Onbehalfof string) *SendTestCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *SendTestCampaignParam) SetSendTestCampaignRequest(SendTestCampaignRequest SendTestCampaignRequest) *SendTestCampaignParam { + params.SendTestCampaignRequest = &SendTestCampaignRequest + return params +} + +// **This endpoint allows you to send a test campaign.** To send to multiple addresses, use an array for the JSON \"to\" value [\"one@address\",\"two@address\"] +func (c *ApiService) SendTestCampaign(params *SendTestCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}/schedules/test" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SendTestCampaignRequest != nil { + b, err := json.Marshal(*params.SendTestCampaignRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &SendATestCampaignRequest{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_service.go b/rest/api/v3/lmc_campaigns/api_service.go new file mode 100644 index 00000000..8f9dfc14 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/lmc_campaigns/api_un_schedule_campaign.go b/rest/api/v3/lmc_campaigns/api_un_schedule_campaign.go new file mode 100644 index 00000000..e6bb7253 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_un_schedule_campaign.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UnScheduleCampaignParam struct { + // + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *UnScheduleCampaignParam) SetCampaignId(CampaignId int32) *UnScheduleCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *UnScheduleCampaignParam) SetOnbehalfof(Onbehalfof string) *UnScheduleCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to unschedule a campaign that has already been scheduled to be sent.** A successful unschedule will return a 204. If the specified campaign is in the process of being sent, the only option is to cancel (a different method). +func (c *ApiService) UnScheduleCampaign(params *UnScheduleCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}/schedules" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_update_campaign.go b/rest/api/v3/lmc_campaigns/api_update_campaign.go new file mode 100644 index 00000000..cb35f513 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_update_campaign.go @@ -0,0 +1,118 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateCampaignParam struct { + // The id of the campaign you would like to retrieve. + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateACampaignRequest *UpdateACampaignRequest `json:"UpdateACampaignRequest,omitempty"` +} + +func (params *UpdateCampaignParam) SetCampaignId(CampaignId int32) *UpdateCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *UpdateCampaignParam) SetOnbehalfof(Onbehalfof string) *UpdateCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateCampaignParam) SetUpdateACampaignRequest(UpdateACampaignRequest UpdateACampaignRequest) *UpdateCampaignParam { + params.UpdateACampaignRequest = &UpdateACampaignRequest + return params +} + +// **This endpoint allows you to update a specific campaign.** This is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters. +func (c *ApiService) UpdateCampaign(params *UpdateCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateACampaignRequest != nil { + b, err := json.Marshal(*params.UpdateACampaignRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Campaigns2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/api_update_scheduled_campaign.go b/rest/api/v3/lmc_campaigns/api_update_scheduled_campaign.go new file mode 100644 index 00000000..433ec883 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/api_update_scheduled_campaign.go @@ -0,0 +1,110 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateScheduledCampaignParam struct { + // + CampaignId *int32 `json:"campaign_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateAScheduledCampaignRequest *UpdateAScheduledCampaignRequest `json:"UpdateAScheduledCampaignRequest,omitempty"` +} + +func (params *UpdateScheduledCampaignParam) SetCampaignId(CampaignId int32) *UpdateScheduledCampaignParam { + params.CampaignId = &CampaignId + return params +} +func (params *UpdateScheduledCampaignParam) SetOnbehalfof(Onbehalfof string) *UpdateScheduledCampaignParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateScheduledCampaignParam) SetUpdateAScheduledCampaignRequest(UpdateAScheduledCampaignRequest UpdateAScheduledCampaignRequest) *UpdateScheduledCampaignParam { + params.UpdateAScheduledCampaignRequest = &UpdateAScheduledCampaignRequest + return params +} + +// **This endpoint allows to you change the scheduled time and date for a campaign to be sent.** +func (c *ApiService) UpdateScheduledCampaign(params *UpdateScheduledCampaignParam) (interface{}, error) { + path := "/v3/campaigns/{CampaignId}/schedules" + if params != nil && params.CampaignId != nil { + path = strings.Replace(path, "{"+"CampaignId"+"}", fmt.Sprint(*params.CampaignId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateAScheduledCampaignRequest != nil { + b, err := json.Marshal(*params.UpdateAScheduledCampaignRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateAScheduledCampaignResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_campaigns/docs/Campaigns2xx.md b/rest/api/v3/lmc_campaigns/docs/Campaigns2xx.md new file mode 100644 index 00000000..0d21e23c --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/Campaigns2xx.md @@ -0,0 +1,24 @@ +# Campaigns2xx + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | **string** | The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI. | +**Subject** | **string** | The subject of your campaign that your recipients will see. |[optional] +**SenderId** | **int32** | The ID of the \"sender\" identity that you have created. Your recipients will see this as the \"from\" on your marketing emails. |[optional] +**ListIds** | **[]int32** | The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs |[optional] +**SegmentIds** | **[]int32** | The segment IDs that you are sending this list to. You can have both segment IDs and list IDs. Segments are limited to 10 segment IDs. |[optional] +**Categories** | **[]string** | The categories you would like associated to this campaign. |[optional] +**SuppressionGroupId** | **int32** | The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type. |[optional] +**CustomUnsubscribeUrl** | **string** | This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups. |[optional] +**IpPool** | **string** | The pool of IPs that you would like to send this email from. |[optional] +**HtmlContent** | **string** | The HTML of your marketing email. |[optional] +**PlainContent** | **string** | The plain text content of your emails. |[optional] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**Status** | **string** | The status of your campaign. | +**Id** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/CreateCampaign.md b/rest/api/v3/lmc_campaigns/docs/CreateCampaign.md new file mode 100644 index 00000000..f7c28367 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/CreateCampaign.md @@ -0,0 +1,49 @@ +# CreateCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateCampaign**](CreateCampaign.md#CreateCampaign) | **Post** /v3/campaigns | Create a Campaign + + + +## CreateCampaign + +> Campaigns2xx CreateCampaign(ctx, optional) + +Create a Campaign + +**This endpoint allows you to create a campaign.** In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**PostCampaignsRequest** | [**PostCampaignsRequest**](PostCampaignsRequest.md) | + +### Return type + +[**Campaigns2xx**](Campaigns2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/DeleteCampaign.md b/rest/api/v3/lmc_campaigns/docs/DeleteCampaign.md new file mode 100644 index 00000000..9cec6c51 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/DeleteCampaign.md @@ -0,0 +1,52 @@ +# DeleteCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteCampaign**](DeleteCampaign.md#DeleteCampaign) | **Delete** /v3/campaigns/{CampaignId} | Delete a Campaign + + + +## DeleteCampaign + +> interface{} DeleteCampaign(ctx, CampaignIdoptional) + +Delete a Campaign + +**This endpoint allows you to delete a specific campaign.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | The id of the campaign you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/Editor.md b/rest/api/v3/lmc_campaigns/docs/Editor.md new file mode 100644 index 00000000..9d170841 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/Editor.md @@ -0,0 +1,13 @@ +# Editor + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CODE** | string | (value: `"code"`) +**DESIGN** | string | (value: `"design"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/ErrorResponse.md b/rest/api/v3/lmc_campaigns/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/ErrorResponseErrorsInner.md b/rest/api/v3/lmc_campaigns/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/GetCampaign.md b/rest/api/v3/lmc_campaigns/docs/GetCampaign.md new file mode 100644 index 00000000..7fe9f996 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/GetCampaign.md @@ -0,0 +1,52 @@ +# GetCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetCampaign**](GetCampaign.md#GetCampaign) | **Get** /v3/campaigns/{CampaignId} | Retrieve a single campaign + + + +## GetCampaign + +> GetCampaign200Response GetCampaign(ctx, CampaignIdoptional) + +Retrieve a single campaign + +**This endpoint allows you to retrieve a specific campaign.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | The id of the campaign you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GetCampaign200Response**](GetCampaign200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/GetCampaign200Response.md b/rest/api/v3/lmc_campaigns/docs/GetCampaign200Response.md new file mode 100644 index 00000000..081bf696 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/GetCampaign200Response.md @@ -0,0 +1,23 @@ +# GetCampaign200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Categories** | **[]string** | |[optional] +**CustomUnsubscribeUrl** | **string** | |[optional] +**HtmlContent** | **string** | |[optional] +**Id** | **int32** | |[optional] +**IpPool** | **string** | |[optional] +**ListIds** | **[]int32** | |[optional] +**PlainContent** | **string** | |[optional] +**SegmentIds** | **[]int32** | |[optional] +**SenderId** | **int32** | |[optional] +**Status** | **string** | |[optional] +**Subject** | **string** | |[optional] +**SuppressionGroupId** | **int32** | |[optional] +**Title** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/GetScheduledCampaign.md b/rest/api/v3/lmc_campaigns/docs/GetScheduledCampaign.md new file mode 100644 index 00000000..66847be7 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/GetScheduledCampaign.md @@ -0,0 +1,52 @@ +# GetScheduledCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetScheduledCampaign**](GetScheduledCampaign.md#GetScheduledCampaign) | **Get** /v3/campaigns/{CampaignId}/schedules | View Scheduled Time of a Campaign + + + +## GetScheduledCampaign + +> ViewScheduledTimeOfACampaignResponse GetScheduledCampaign(ctx, CampaignIdoptional) + +View Scheduled Time of a Campaign + +**This endpoint allows you to retrieve the date and time that a campaign has been scheduled to be sent.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetScheduledCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ViewScheduledTimeOfACampaignResponse**](ViewScheduledTimeOfACampaignResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/ListCampaign.md b/rest/api/v3/lmc_campaigns/docs/ListCampaign.md new file mode 100644 index 00000000..103eaf98 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ListCampaign.md @@ -0,0 +1,50 @@ +# ListCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCampaign**](ListCampaign.md#ListCampaign) | **Get** /v3/campaigns | Retrieve all Campaigns + + + +## ListCampaign + +> ListCampaign200Response ListCampaign(ctx, optional) + +Retrieve all Campaigns + +**This endpoint allows you to retrieve a paginated list of all of your campaigns.** Returns campaigns in reverse order they were created (newest first). Returns an empty array if no campaigns exist. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListCampaign200Response**](ListCampaign200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/ListCampaign200Response.md b/rest/api/v3/lmc_campaigns/docs/ListCampaign200Response.md new file mode 100644 index 00000000..4cb67061 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ListCampaign200Response.md @@ -0,0 +1,11 @@ +# ListCampaign200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]Campaigns2xx**](Campaigns2xx.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/PostCampaignsRequest.md b/rest/api/v3/lmc_campaigns/docs/PostCampaignsRequest.md new file mode 100644 index 00000000..aa92e8b4 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/PostCampaignsRequest.md @@ -0,0 +1,22 @@ +# PostCampaignsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | **string** | The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI. | +**Subject** | **string** | The subject of your campaign that your recipients will see. |[optional] +**SenderId** | **int32** | The ID of the \"sender\" identity that you have created. Your recipients will see this as the \"from\" on your marketing emails. |[optional] +**ListIds** | **[]int32** | The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs |[optional] +**SegmentIds** | **[]int32** | The segment IDs that you are sending this list to. You can have both segment IDs and list IDs. Segments are limited to 10 segment IDs. |[optional] +**Categories** | **[]string** | The categories you would like associated to this campaign. |[optional] +**SuppressionGroupId** | **int32** | The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type. |[optional] +**CustomUnsubscribeUrl** | **string** | This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups. |[optional] +**IpPool** | **string** | The pool of IPs that you would like to send this email from. |[optional] +**HtmlContent** | **string** | The HTML of your marketing email. |[optional] +**PlainContent** | **string** | The plain text content of your emails. |[optional] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/ScheduleACampaignRequest.md b/rest/api/v3/lmc_campaigns/docs/ScheduleACampaignRequest.md new file mode 100644 index 00000000..489650a2 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ScheduleACampaignRequest.md @@ -0,0 +1,11 @@ +# ScheduleACampaignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SendAt** | **int32** | The unix timestamp for the date and time you would like your campaign to be sent out. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/ScheduleACampaignResponse.md b/rest/api/v3/lmc_campaigns/docs/ScheduleACampaignResponse.md new file mode 100644 index 00000000..3e850370 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ScheduleACampaignResponse.md @@ -0,0 +1,13 @@ +# ScheduleACampaignResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The campaign ID. | +**SendAt** | **int32** | The date time you scheduled your campaign to be sent. | +**Status** | [**Status**](Status.md) | The status of your campaign. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/ScheduleCampaign.md b/rest/api/v3/lmc_campaigns/docs/ScheduleCampaign.md new file mode 100644 index 00000000..257a83bf --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ScheduleCampaign.md @@ -0,0 +1,53 @@ +# ScheduleCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ScheduleCampaign**](ScheduleCampaign.md#ScheduleCampaign) | **Post** /v3/campaigns/{CampaignId}/schedules | Schedule a Campaign + + + +## ScheduleCampaign + +> ScheduleACampaignResponse ScheduleCampaign(ctx, CampaignIdoptional) + +Schedule a Campaign + +**This endpoint allows you to schedule a specific date and time for your campaign to be sent.** If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won't be going through our servers at the same times as everyone else's mail. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a ScheduleCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**ScheduleACampaignRequest** | [**ScheduleACampaignRequest**](ScheduleACampaignRequest.md) | + +### Return type + +[**ScheduleACampaignResponse**](ScheduleACampaignResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/SendACampaignResponse.md b/rest/api/v3/lmc_campaigns/docs/SendACampaignResponse.md new file mode 100644 index 00000000..5b5d6e36 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/SendACampaignResponse.md @@ -0,0 +1,12 @@ +# SendACampaignResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int64** | | +**Status** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/SendATestCampaignRequest.md b/rest/api/v3/lmc_campaigns/docs/SendATestCampaignRequest.md new file mode 100644 index 00000000..7312efcb --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/SendATestCampaignRequest.md @@ -0,0 +1,11 @@ +# SendATestCampaignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**To** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/SendCampaign.md b/rest/api/v3/lmc_campaigns/docs/SendCampaign.md new file mode 100644 index 00000000..8e303880 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/SendCampaign.md @@ -0,0 +1,52 @@ +# SendCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SendCampaign**](SendCampaign.md#SendCampaign) | **Post** /v3/campaigns/{CampaignId}/schedules/now | Send a Campaign + + + +## SendCampaign + +> SendACampaignResponse SendCampaign(ctx, CampaignIdoptional) + +Send a Campaign + +**This endpoint allows you to immediately send an existing campaign.** Normally a POST request would have a body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a SendCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**SendACampaignResponse**](SendACampaignResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/SendTestCampaign.md b/rest/api/v3/lmc_campaigns/docs/SendTestCampaign.md new file mode 100644 index 00000000..8fdf3672 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/SendTestCampaign.md @@ -0,0 +1,53 @@ +# SendTestCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SendTestCampaign**](SendTestCampaign.md#SendTestCampaign) | **Post** /v3/campaigns/{CampaignId}/schedules/test | Send a Test Campaign + + + +## SendTestCampaign + +> SendATestCampaignRequest SendTestCampaign(ctx, CampaignIdoptional) + +Send a Test Campaign + +**This endpoint allows you to send a test campaign.** To send to multiple addresses, use an array for the JSON \"to\" value [\"one@address\",\"two@address\"] + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a SendTestCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**SendTestCampaignRequest** | [**SendTestCampaignRequest**](SendTestCampaignRequest.md) | + +### Return type + +[**SendATestCampaignRequest**](SendATestCampaignRequest.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/SendTestCampaignRequest.md b/rest/api/v3/lmc_campaigns/docs/SendTestCampaignRequest.md new file mode 100644 index 00000000..3b22fcad --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/SendTestCampaignRequest.md @@ -0,0 +1,11 @@ +# SendTestCampaignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**To** | **string** | The email address that should receive the test campaign. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/Status.md b/rest/api/v3/lmc_campaigns/docs/Status.md new file mode 100644 index 00000000..6f087e79 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/Status.md @@ -0,0 +1,12 @@ +# Status + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SCHEDULED** | string | (value: `"Scheduled"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/UnScheduleCampaign.md b/rest/api/v3/lmc_campaigns/docs/UnScheduleCampaign.md new file mode 100644 index 00000000..a6b87142 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/UnScheduleCampaign.md @@ -0,0 +1,52 @@ +# UnScheduleCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UnScheduleCampaign**](UnScheduleCampaign.md#UnScheduleCampaign) | **Delete** /v3/campaigns/{CampaignId}/schedules | Unschedule a Scheduled Campaign + + + +## UnScheduleCampaign + +> interface{} UnScheduleCampaign(ctx, CampaignIdoptional) + +Unschedule a Scheduled Campaign + +**This endpoint allows you to unschedule a campaign that has already been scheduled to be sent.** A successful unschedule will return a 204. If the specified campaign is in the process of being sent, the only option is to cancel (a different method). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a UnScheduleCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/UpdateACampaignRequest.md b/rest/api/v3/lmc_campaigns/docs/UpdateACampaignRequest.md new file mode 100644 index 00000000..18686464 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/UpdateACampaignRequest.md @@ -0,0 +1,15 @@ +# UpdateACampaignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | **string** | The title of the campaign. | +**Subject** | **string** | The subject line for your campaign. | +**Categories** | **[]string** | The categories you want to tag on this campaign. | +**HtmlContent** | **string** | The HTML content of this campaign. | +**PlainContent** | **string** | The plain content of this campaign. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignRequest.md b/rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignRequest.md new file mode 100644 index 00000000..95153a0c --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignRequest.md @@ -0,0 +1,11 @@ +# UpdateAScheduledCampaignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SendAt** | **int64** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignResponse.md b/rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignResponse.md new file mode 100644 index 00000000..ca58edfc --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/UpdateAScheduledCampaignResponse.md @@ -0,0 +1,13 @@ +# UpdateAScheduledCampaignResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The campaign ID | +**SendAt** | **int32** | The unix timestamp to send the campaign. | +**Status** | **string** | The status of the schedule. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/docs/UpdateCampaign.md b/rest/api/v3/lmc_campaigns/docs/UpdateCampaign.md new file mode 100644 index 00000000..763d4a0a --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/UpdateCampaign.md @@ -0,0 +1,53 @@ +# UpdateCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateCampaign**](UpdateCampaign.md#UpdateCampaign) | **Patch** /v3/campaigns/{CampaignId} | Update a Campaign + + + +## UpdateCampaign + +> Campaigns2xx UpdateCampaign(ctx, CampaignIdoptional) + +Update a Campaign + +**This endpoint allows you to update a specific campaign.** This is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | The id of the campaign you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateACampaignRequest** | [**UpdateACampaignRequest**](UpdateACampaignRequest.md) | + +### Return type + +[**Campaigns2xx**](Campaigns2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/UpdateScheduledCampaign.md b/rest/api/v3/lmc_campaigns/docs/UpdateScheduledCampaign.md new file mode 100644 index 00000000..936135ed --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/UpdateScheduledCampaign.md @@ -0,0 +1,53 @@ +# UpdateScheduledCampaign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateScheduledCampaign**](UpdateScheduledCampaign.md#UpdateScheduledCampaign) | **Patch** /v3/campaigns/{CampaignId}/schedules | Update a Scheduled Campaign + + + +## UpdateScheduledCampaign + +> UpdateAScheduledCampaignResponse UpdateScheduledCampaign(ctx, CampaignIdoptional) + +Update a Scheduled Campaign + +**This endpoint allows to you change the scheduled time and date for a campaign to be sent.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CampaignId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateScheduledCampaignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateAScheduledCampaignRequest** | [**UpdateAScheduledCampaignRequest**](UpdateAScheduledCampaignRequest.md) | + +### Return type + +[**UpdateAScheduledCampaignResponse**](UpdateAScheduledCampaignResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_campaigns/docs/ViewScheduledTimeOfACampaignResponse.md b/rest/api/v3/lmc_campaigns/docs/ViewScheduledTimeOfACampaignResponse.md new file mode 100644 index 00000000..76d1e22d --- /dev/null +++ b/rest/api/v3/lmc_campaigns/docs/ViewScheduledTimeOfACampaignResponse.md @@ -0,0 +1,11 @@ +# ViewScheduledTimeOfACampaignResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SendAt** | **int64** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_campaigns/model_campaigns2xx.go b/rest/api/v3/lmc_campaigns/model_campaigns2xx.go new file mode 100644 index 00000000..f8c3ccfd --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_campaigns2xx.go @@ -0,0 +1,45 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Campaigns2xx struct for Campaigns2xx +type Campaigns2xx struct { + // The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI. + Title string `json:"title"` + // The subject of your campaign that your recipients will see. + Subject *string `json:"subject,omitempty"` + // The ID of the \"sender\" identity that you have created. Your recipients will see this as the \"from\" on your marketing emails. + SenderId *int32 `json:"sender_id,omitempty"` + // The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs + ListIds *[]int32 `json:"list_ids,omitempty"` + // The segment IDs that you are sending this list to. You can have both segment IDs and list IDs. Segments are limited to 10 segment IDs. + SegmentIds *[]int32 `json:"segment_ids,omitempty"` + // The categories you would like associated to this campaign. + Categories *[]string `json:"categories,omitempty"` + // The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type. + SuppressionGroupId *int32 `json:"suppression_group_id,omitempty"` + // This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups. + CustomUnsubscribeUrl *string `json:"custom_unsubscribe_url,omitempty"` + // The pool of IPs that you would like to send this email from. + IpPool *string `json:"ip_pool,omitempty"` + // The HTML of your marketing email. + HtmlContent *string `json:"html_content,omitempty"` + // The plain text content of your emails. + PlainContent *string `json:"plain_content,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // The status of your campaign. + Status string `json:"status"` + Id *int32 `json:"id,omitempty"` +} diff --git a/rest/api/v3/lmc_campaigns/model_editor.go b/rest/api/v3/lmc_campaigns/model_editor.go new file mode 100644 index 00000000..4af6f4bb --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_editor.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Editor the model 'Editor' +type Editor string + +// List of Editor +const ( + EDITOR_CODE Editor = "code" + EDITOR_DESIGN Editor = "design" +) diff --git a/rest/api/v3/lmc_campaigns/model_error_response.go b/rest/api/v3/lmc_campaigns/model_error_response.go new file mode 100644 index 00000000..fd2e601a --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/lmc_campaigns/model_error_response_errors_inner.go b/rest/api/v3/lmc_campaigns/model_error_response_errors_inner.go new file mode 100644 index 00000000..77addddc --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/lmc_campaigns/model_get_campaign_200_response.go b/rest/api/v3/lmc_campaigns/model_get_campaign_200_response.go new file mode 100644 index 00000000..7c675785 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_get_campaign_200_response.go @@ -0,0 +1,31 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetCampaign200Response struct for GetCampaign200Response +type GetCampaign200Response struct { + Categories *[]string `json:"categories,omitempty"` + CustomUnsubscribeUrl *string `json:"custom_unsubscribe_url,omitempty"` + HtmlContent *string `json:"html_content,omitempty"` + Id *int32 `json:"id,omitempty"` + IpPool *string `json:"ip_pool,omitempty"` + ListIds *[]int32 `json:"list_ids,omitempty"` + PlainContent *string `json:"plain_content,omitempty"` + SegmentIds *[]int32 `json:"segment_ids,omitempty"` + SenderId *int32 `json:"sender_id,omitempty"` + Status *string `json:"status,omitempty"` + Subject *string `json:"subject,omitempty"` + SuppressionGroupId *int32 `json:"suppression_group_id,omitempty"` + Title *string `json:"title,omitempty"` +} diff --git a/rest/api/v3/lmc_campaigns/model_list_campaign_200_response.go b/rest/api/v3/lmc_campaigns/model_list_campaign_200_response.go new file mode 100644 index 00000000..47cc209c --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_list_campaign_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCampaign200Response struct for ListCampaign200Response +type ListCampaign200Response struct { + Result *[]Campaigns2xx `json:"result,omitempty"` +} diff --git a/rest/api/v3/lmc_campaigns/model_post_campaigns_request.go b/rest/api/v3/lmc_campaigns/model_post_campaigns_request.go new file mode 100644 index 00000000..0cc45837 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_post_campaigns_request.go @@ -0,0 +1,42 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PostCampaignsRequest struct for PostCampaignsRequest +type PostCampaignsRequest struct { + // The display title of your campaign. This will be viewable by you in the Marketing Campaigns UI. + Title string `json:"title"` + // The subject of your campaign that your recipients will see. + Subject *string `json:"subject,omitempty"` + // The ID of the \"sender\" identity that you have created. Your recipients will see this as the \"from\" on your marketing emails. + SenderId *int32 `json:"sender_id,omitempty"` + // The IDs of the lists you are sending this campaign to. You can have both segment IDs and list IDs + ListIds *[]int32 `json:"list_ids,omitempty"` + // The segment IDs that you are sending this list to. You can have both segment IDs and list IDs. Segments are limited to 10 segment IDs. + SegmentIds *[]int32 `json:"segment_ids,omitempty"` + // The categories you would like associated to this campaign. + Categories *[]string `json:"categories,omitempty"` + // The suppression group that this marketing email belongs to, allowing recipients to opt-out of emails of this type. + SuppressionGroupId *int32 `json:"suppression_group_id,omitempty"` + // This is the url of the custom unsubscribe page that you provide for customers to unsubscribe from your suppression groups. + CustomUnsubscribeUrl *string `json:"custom_unsubscribe_url,omitempty"` + // The pool of IPs that you would like to send this email from. + IpPool *string `json:"ip_pool,omitempty"` + // The HTML of your marketing email. + HtmlContent *string `json:"html_content,omitempty"` + // The plain text content of your emails. + PlainContent *string `json:"plain_content,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` +} diff --git a/rest/api/v3/lmc_campaigns/model_schedule_a_campaign_request.go b/rest/api/v3/lmc_campaigns/model_schedule_a_campaign_request.go new file mode 100644 index 00000000..4b53f35b --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_schedule_a_campaign_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ScheduleACampaignRequest struct for ScheduleACampaignRequest +type ScheduleACampaignRequest struct { + // The unix timestamp for the date and time you would like your campaign to be sent out. + SendAt int32 `json:"send_at"` +} diff --git a/rest/api/v3/lmc_campaigns/model_schedule_a_campaign_response.go b/rest/api/v3/lmc_campaigns/model_schedule_a_campaign_response.go new file mode 100644 index 00000000..62df9ad9 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_schedule_a_campaign_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ScheduleACampaignResponse struct for ScheduleACampaignResponse +type ScheduleACampaignResponse struct { + // The campaign ID. + Id int32 `json:"id"` + // The date time you scheduled your campaign to be sent. + SendAt int32 `json:"send_at"` + // The status of your campaign. + Status Status `json:"status"` +} diff --git a/rest/api/v3/lmc_campaigns/model_send_a_campaign_response.go b/rest/api/v3/lmc_campaigns/model_send_a_campaign_response.go new file mode 100644 index 00000000..75f64bda --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_send_a_campaign_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendACampaignResponse struct for SendACampaignResponse +type SendACampaignResponse struct { + Id int64 `json:"id"` + Status string `json:"status"` +} diff --git a/rest/api/v3/lmc_campaigns/model_send_a_test_campaign_request.go b/rest/api/v3/lmc_campaigns/model_send_a_test_campaign_request.go new file mode 100644 index 00000000..48db5624 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_send_a_test_campaign_request.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendATestCampaignRequest struct for SendATestCampaignRequest +type SendATestCampaignRequest struct { + To string `json:"to"` +} diff --git a/rest/api/v3/lmc_campaigns/model_send_test_campaign_request.go b/rest/api/v3/lmc_campaigns/model_send_test_campaign_request.go new file mode 100644 index 00000000..facd4d89 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_send_test_campaign_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendTestCampaignRequest struct for SendTestCampaignRequest +type SendTestCampaignRequest struct { + // The email address that should receive the test campaign. + To string `json:"to"` +} diff --git a/rest/api/v3/lmc_campaigns/model_status.go b/rest/api/v3/lmc_campaigns/model_status.go new file mode 100644 index 00000000..099841ea --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_status.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status the model 'Status' +type Status string + +// List of Status +const ( + STATUS_SCHEDULED Status = "Scheduled" +) diff --git a/rest/api/v3/lmc_campaigns/model_update_a_campaign_request.go b/rest/api/v3/lmc_campaigns/model_update_a_campaign_request.go new file mode 100644 index 00000000..be297454 --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_update_a_campaign_request.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateACampaignRequest struct for UpdateACampaignRequest +type UpdateACampaignRequest struct { + // The title of the campaign. + Title string `json:"title"` + // The subject line for your campaign. + Subject string `json:"subject"` + // The categories you want to tag on this campaign. + Categories []string `json:"categories"` + // The HTML content of this campaign. + HtmlContent string `json:"html_content"` + // The plain content of this campaign. + PlainContent string `json:"plain_content"` +} diff --git a/rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_request.go b/rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_request.go new file mode 100644 index 00000000..e7a6d7cf --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_request.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateAScheduledCampaignRequest struct for UpdateAScheduledCampaignRequest +type UpdateAScheduledCampaignRequest struct { + SendAt int64 `json:"send_at"` +} diff --git a/rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_response.go b/rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_response.go new file mode 100644 index 00000000..1f31db5a --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_update_a_scheduled_campaign_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateAScheduledCampaignResponse struct for UpdateAScheduledCampaignResponse +type UpdateAScheduledCampaignResponse struct { + // The campaign ID + Id int32 `json:"id"` + // The unix timestamp to send the campaign. + SendAt int32 `json:"send_at"` + // The status of the schedule. + Status string `json:"status"` +} diff --git a/rest/api/v3/lmc_campaigns/model_view_scheduled_time_of_a_campaign_response.go b/rest/api/v3/lmc_campaigns/model_view_scheduled_time_of_a_campaign_response.go new file mode 100644 index 00000000..e224df4c --- /dev/null +++ b/rest/api/v3/lmc_campaigns/model_view_scheduled_time_of_a_campaign_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Campaigns API +* The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid [Single Sends](https://docs.sendgrid.com/api-reference/single-sends/) and [Automations](https://docs.sendgrid.com/ui/sending-email/getting-started-with-automation). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ViewScheduledTimeOfACampaignResponse struct for ViewScheduledTimeOfACampaignResponse +type ViewScheduledTimeOfACampaignResponse struct { + SendAt int64 `json:"send_at"` +} diff --git a/rest/api/v3/lmc_contactdb/README.md b/rest/api/v3/lmc_contactdb/README.md new file mode 100644 index 00000000..45861477 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/README.md @@ -0,0 +1,134 @@ +# Go API client for + +The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. + +See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.502496+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AddRecipient* | [**AddRecipient**](docs/AddRecipient.md#addrecipient) | **Post** /v3/contactdb/recipients | Add recipients +*AddRecipientToContactDbList* | [**AddRecipientToContactDbList**](docs/AddRecipientToContactDbList.md#addrecipienttocontactdblist) | **Post** /v3/contactdb/lists/{ListId}/recipients/{RecipientId} | Add a Single Recipient to a List +*AddRecipientsToContactDbList* | [**AddRecipientsToContactDbList**](docs/AddRecipientsToContactDbList.md#addrecipientstocontactdblist) | **Post** /v3/contactdb/lists/{ListId}/recipients | Add Multiple Recipients to a List +*CreateContactDbList* | [**CreateContactDbList**](docs/CreateContactDbList.md#createcontactdblist) | **Post** /v3/contactdb/lists | Create a List +*CreateCustomField* | [**CreateCustomField**](docs/CreateCustomField.md#createcustomfield) | **Post** /v3/contactdb/custom_fields | Create a Custom Field +*CreateSegment* | [**CreateSegment**](docs/CreateSegment.md#createsegment) | **Post** /v3/contactdb/segments | Create a Segment +*DeleteContactDbList* | [**DeleteContactDbList**](docs/DeleteContactDbList.md#deletecontactdblist) | **Delete** /v3/contactdb/lists/{ListId} | Delete a List +*DeleteContactDbLists* | [**DeleteContactDbLists**](docs/DeleteContactDbLists.md#deletecontactdblists) | **Delete** /v3/contactdb/lists | Delete Multiple lists +*DeleteCustomField* | [**DeleteCustomField**](docs/DeleteCustomField.md#deletecustomfield) | **Delete** /v3/contactdb/custom_fields/{CustomFieldId} | Delete a Custom Field +*DeleteRecipient* | [**DeleteRecipient**](docs/DeleteRecipient.md#deleterecipient) | **Delete** /v3/contactdb/recipients/{RecipientId} | Delete a Recipient +*DeleteRecipientFromContactDbList* | [**DeleteRecipientFromContactDbList**](docs/DeleteRecipientFromContactDbList.md#deleterecipientfromcontactdblist) | **Delete** /v3/contactdb/lists/{ListId}/recipients/{RecipientId} | Delete a Single Recipient from a Single List +*DeleteRecipients* | [**DeleteRecipients**](docs/DeleteRecipients.md#deleterecipients) | **Delete** /v3/contactdb/recipients | Delete Recipients +*DeleteSegment* | [**DeleteSegment**](docs/DeleteSegment.md#deletesegment) | **Delete** /v3/contactdb/segments/{SegmentId} | Delete a segment +*GetBillable* | [**GetBillable**](docs/GetBillable.md#getbillable) | **Get** /v3/contactdb/recipients/billable_count | Retrieve the count of billable recipients +*GetContactDbList* | [**GetContactDbList**](docs/GetContactDbList.md#getcontactdblist) | **Get** /v3/contactdb/lists/{ListId} | Retrieve a single list +*GetCustomField* | [**GetCustomField**](docs/GetCustomField.md#getcustomfield) | **Get** /v3/contactdb/custom_fields/{CustomFieldId} | Retrieve a Custom Field +*GetRecipient* | [**GetRecipient**](docs/GetRecipient.md#getrecipient) | **Get** /v3/contactdb/recipients/{RecipientId} | Retrieve a single recipient +*GetRecipientList* | [**GetRecipientList**](docs/GetRecipientList.md#getrecipientlist) | **Get** /v3/contactdb/recipients/{RecipientId}/lists | Retrieve the lists that a recipient is on +*GetSegment* | [**GetSegment**](docs/GetSegment.md#getsegment) | **Get** /v3/contactdb/segments/{SegmentId} | Retrieve a segment +*ListContactDbList* | [**ListContactDbList**](docs/ListContactDbList.md#listcontactdblist) | **Get** /v3/contactdb/lists | Retrieve all lists +*ListCustomField* | [**ListCustomField**](docs/ListCustomField.md#listcustomfield) | **Get** /v3/contactdb/custom_fields | Retrieve all custom fields +*ListRecipient* | [**ListRecipient**](docs/ListRecipient.md#listrecipient) | **Get** /v3/contactdb/recipients | Retrieve recipients +*ListRecipientCount* | [**ListRecipientCount**](docs/ListRecipientCount.md#listrecipientcount) | **Get** /v3/contactdb/recipients/count | Retrieve a Count of Recipients +*ListRecipientForSegment* | [**ListRecipientForSegment**](docs/ListRecipientForSegment.md#listrecipientforsegment) | **Get** /v3/contactdb/segments/{SegmentId}/recipients | Retrieve recipients on a segment +*ListRecipientsFromContactDbList* | [**ListRecipientsFromContactDbList**](docs/ListRecipientsFromContactDbList.md#listrecipientsfromcontactdblist) | **Get** /v3/contactdb/lists/{ListId}/recipients | Retrieve all recipients on a List +*ListReservedField* | [**ListReservedField**](docs/ListReservedField.md#listreservedfield) | **Get** /v3/contactdb/reserved_fields | Retrieve reserved fields +*ListSearchRecipient* | [**ListSearchRecipient**](docs/ListSearchRecipient.md#listsearchrecipient) | **Get** /v3/contactdb/recipients/search | Search recipients +*ListSegment* | [**ListSegment**](docs/ListSegment.md#listsegment) | **Get** /v3/contactdb/segments | Retrieve all segments +*ListStatus* | [**ListStatus**](docs/ListStatus.md#liststatus) | **Get** /v3/contactdb/status | Get Recipient Upload Status +*SearchRecipient* | [**SearchRecipient**](docs/SearchRecipient.md#searchrecipient) | **Post** /v3/contactdb/recipients/search | Search recipients +*UpdateContactDbList* | [**UpdateContactDbList**](docs/UpdateContactDbList.md#updatecontactdblist) | **Patch** /v3/contactdb/lists/{ListId} | Update a List +*UpdateRecipient* | [**UpdateRecipient**](docs/UpdateRecipient.md#updaterecipient) | **Patch** /v3/contactdb/recipients | Update Recipient +*UpdateSegment* | [**UpdateSegment**](docs/UpdateSegment.md#updatesegment) | **Patch** /v3/contactdb/segments/{SegmentId} | Update a segment + + +## Documentation For Models + + - [AddRecipientRequestInner](AddRecipientRequestInner.md) + - [AndOr](AndOr.md) + - [ContactdbCustomField](ContactdbCustomField.md) + - [ContactdbCustomFieldId2xx](ContactdbCustomFieldId2xx.md) + - [ContactdbCustomFieldIdValue](ContactdbCustomFieldIdValue.md) + - [ContactdbList2xx](ContactdbList2xx.md) + - [ContactdbRecipient200](ContactdbRecipient200.md) + - [ContactdbRecipient200RecipientsInner](ContactdbRecipient200RecipientsInner.md) + - [ContactdbRecipientCount200](ContactdbRecipientCount200.md) + - [ContactdbRecipientResponse201](ContactdbRecipientResponse201.md) + - [ContactdbRecipientResponse201ErrorsInner](ContactdbRecipientResponse201ErrorsInner.md) + - [ContactdbSegments](ContactdbSegments.md) + - [ContactdbSegmentsConditions](ContactdbSegmentsConditions.md) + - [ContactdbSegmentsId200](ContactdbSegmentsId200.md) + - [CreateAListRequest](CreateAListRequest.md) + - [CreateCustomFieldRequest](CreateCustomFieldRequest.md) + - [DeleteContacts](DeleteContacts.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [GetRecipientList200Response](GetRecipientList200Response.md) + - [ListAllCustomFieldsResponse](ListAllCustomFieldsResponse.md) + - [ListAllListsResponse](ListAllListsResponse.md) + - [ListAllSegmentsResponse](ListAllSegmentsResponse.md) + - [ListRecipientsFromContactDbList200Response](ListRecipientsFromContactDbList200Response.md) + - [ListRecipientsOnASegmentResponse](ListRecipientsOnASegmentResponse.md) + - [ListRecipientsResponse](ListRecipientsResponse.md) + - [ListReservedField200Response](ListReservedField200Response.md) + - [ListReservedField200ResponseReservedFieldsInner](ListReservedField200ResponseReservedFieldsInner.md) + - [ListStatus200Response](ListStatus200Response.md) + - [ListStatus200ResponseStatusInner](ListStatus200ResponseStatusInner.md) + - [Operator](Operator.md) + - [SearchRecipient200Response](SearchRecipient200Response.md) + - [SearchRecipient200ResponseRecipientsInner](SearchRecipient200ResponseRecipientsInner.md) + - [SearchRecipient200ResponseRecipientsInnerCustomFieldsInner](SearchRecipient200ResponseRecipientsInnerCustomFieldsInner.md) + - [SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue](SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue.md) + - [SearchRecipientRequest](SearchRecipientRequest.md) + - [Type](Type.md) + - [UpdateAListRequest](UpdateAListRequest.md) + - [UpdateContactDbList200Response](UpdateContactDbList200Response.md) + - [UpdateRecipientRequestInner](UpdateRecipientRequestInner.md) + - [UpdateSegmentRequest](UpdateSegmentRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/lmc_contactdb/api_add_recipient.go b/rest/api/v3/lmc_contactdb/api_add_recipient.go new file mode 100644 index 00000000..b769b98b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_add_recipient.go @@ -0,0 +1,90 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type AddRecipientParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + AddRecipientRequestInner *[]AddRecipientRequestInner `json:"AddRecipientRequestInner,omitempty"` +} + +func (params *AddRecipientParam) SetOnbehalfof(Onbehalfof string) *AddRecipientParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *AddRecipientParam) SetAddRecipientRequestInner(AddRecipientRequestInner []AddRecipientRequestInner) *AddRecipientParam { + params.AddRecipientRequestInner = &AddRecipientRequestInner + return params +} + +// **This endpoint allows you to add a Marketing Campaigns recipient.** You can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides. The rate limit is three requests every 2 seconds. You can upload 1000 contacts per request. So the maximum upload rate is 1500 recipients per second. +func (c *ApiService) AddRecipient(params *AddRecipientParam) (interface{}, error) { + path := "/v3/contactdb/recipients" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.AddRecipientRequestInner != nil { + b, err := json.Marshal(*params.AddRecipientRequestInner) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ContactdbRecipientResponse201{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_add_recipient_to_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_add_recipient_to_contact_db_list.go new file mode 100644 index 00000000..c5df2a19 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_add_recipient_to_contact_db_list.go @@ -0,0 +1,96 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type AddRecipientToContactDbListParam struct { + // The ID of the list that you want to add the recipient to. + ListId *int32 `json:"list_id"` + // The ID of the recipient you are adding to the list. + RecipientId *string `json:"recipient_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *AddRecipientToContactDbListParam) SetListId(ListId int32) *AddRecipientToContactDbListParam { + params.ListId = &ListId + return params +} +func (params *AddRecipientToContactDbListParam) SetRecipientId(RecipientId string) *AddRecipientToContactDbListParam { + params.RecipientId = &RecipientId + return params +} +func (params *AddRecipientToContactDbListParam) SetOnbehalfof(Onbehalfof string) *AddRecipientToContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to add a single recipient to a list.** +func (c *ApiService) AddRecipientToContactDbList(params *AddRecipientToContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists/{ListId}/recipients/{RecipientId}" + if params != nil && params.ListId != nil { + path = strings.Replace(path, "{"+"ListId"+"}", fmt.Sprint(*params.ListId), -1) + } + if params != nil && params.RecipientId != nil { + path = strings.Replace(path, "{"+"RecipientId"+"}", *params.RecipientId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_add_recipients_to_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_add_recipients_to_contact_db_list.go new file mode 100644 index 00000000..f41944ce --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_add_recipients_to_contact_db_list.go @@ -0,0 +1,102 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type AddRecipientsToContactDbListParam struct { + // The id of the list of recipients you want to retrieve. + ListId *int32 `json:"list_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + RequestBody *[]string `json:"request_body,omitempty"` +} + +func (params *AddRecipientsToContactDbListParam) SetListId(ListId int32) *AddRecipientsToContactDbListParam { + params.ListId = &ListId + return params +} +func (params *AddRecipientsToContactDbListParam) SetOnbehalfof(Onbehalfof string) *AddRecipientsToContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *AddRecipientsToContactDbListParam) SetRequestBody(RequestBody []string) *AddRecipientsToContactDbListParam { + params.RequestBody = &RequestBody + return params +} + +// **This endpoint allows you to add multiple recipients to a list.** Adds existing recipients to a list, passing in the recipient IDs to add. Recipient IDs (base64-encoded email addresses) should be passed exactly as they are returned from recipient endpoints. +func (c *ApiService) AddRecipientsToContactDbList(params *AddRecipientsToContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists/{ListId}/recipients" + if params != nil && params.ListId != nil { + path = strings.Replace(path, "{"+"ListId"+"}", fmt.Sprint(*params.ListId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.RequestBody != nil { + b, err := json.Marshal(*params.RequestBody) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_create_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_create_contact_db_list.go new file mode 100644 index 00000000..a16254d8 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_create_contact_db_list.go @@ -0,0 +1,90 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateContactDbListParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateAListRequest *CreateAListRequest `json:"CreateAListRequest,omitempty"` +} + +func (params *CreateContactDbListParam) SetOnbehalfof(Onbehalfof string) *CreateContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateContactDbListParam) SetCreateAListRequest(CreateAListRequest CreateAListRequest) *CreateContactDbListParam { + params.CreateAListRequest = &CreateAListRequest + return params +} + +// **This endpoint allows you to create a list for your recipients.** +func (c *ApiService) CreateContactDbList(params *CreateContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateAListRequest != nil { + b, err := json.Marshal(*params.CreateAListRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ContactdbList2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_create_custom_field.go b/rest/api/v3/lmc_contactdb/api_create_custom_field.go new file mode 100644 index 00000000..79fb8a50 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_create_custom_field.go @@ -0,0 +1,82 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateCustomFieldParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateCustomFieldRequest *CreateCustomFieldRequest `json:"CreateCustomFieldRequest,omitempty"` +} + +func (params *CreateCustomFieldParam) SetOnbehalfof(Onbehalfof string) *CreateCustomFieldParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateCustomFieldParam) SetCreateCustomFieldRequest(CreateCustomFieldRequest CreateCustomFieldRequest) *CreateCustomFieldParam { + params.CreateCustomFieldRequest = &CreateCustomFieldRequest + return params +} + +// **This endpoint allows you to create a custom field.** **You can create up to 120 custom fields.** +func (c *ApiService) CreateCustomField(params *CreateCustomFieldParam) (interface{}, error) { + path := "/v3/contactdb/custom_fields" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateCustomFieldRequest != nil { + b, err := json.Marshal(*params.CreateCustomFieldRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ContactdbCustomFieldId2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_create_segment.go b/rest/api/v3/lmc_contactdb/api_create_segment.go new file mode 100644 index 00000000..883987dc --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_create_segment.go @@ -0,0 +1,90 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSegmentParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + ContactdbSegments *ContactdbSegments `json:"ContactdbSegments,omitempty"` +} + +func (params *CreateSegmentParam) SetOnbehalfof(Onbehalfof string) *CreateSegmentParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateSegmentParam) SetContactdbSegments(ContactdbSegments ContactdbSegments) *CreateSegmentParam { + params.ContactdbSegments = &ContactdbSegments + return params +} + +// **This endpoint allows you to create a new segment.** Valid operators for create and update depend on the type of the field for which you are searching. **Dates** - \"eq\", \"ne\", \"lt\" (before), \"gt\" (after) - You may use MM/DD/YYYY for day granularity or an epoch for second granularity. - \"empty\", \"not_empty\" - \"is within\" - You may use an [ISO 8601 date format](https://en.wikipedia.org/wiki/ISO_8601) or the # of days. **Text** - \"contains\" - \"eq\" (is/equals - matches the full field) - \"ne\" (is not/not equals - matches any field where the entire field is not the condition value) - \"empty\" - \"not_empty\" **Numbers** - \"eq\" (is/equals) - \"lt\" (is less than) - \"gt\" (is greater than) - \"empty\" - \"not_empty\" **Email Clicks and Opens** - \"eq\" (opened) - \"ne\" (not opened) All field values must be a string. Conditions using \"eq\" or \"ne\" for email clicks and opens should provide a \"field\" of either `clicks.campaign_identifier` or `opens.campaign_identifier`. The condition value should be a string containing the id of a completed campaign. The conditions list may contain multiple conditions, joined by an \"and\" or \"or\" in the \"and_or\" field. The first condition in the conditions list must have an empty \"and_or\", and subsequent conditions must all specify an \"and_or\". +func (c *ApiService) CreateSegment(params *CreateSegmentParam) (interface{}, error) { + path := "/v3/contactdb/segments" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.ContactdbSegments != nil { + b, err := json.Marshal(*params.ContactdbSegments) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbSegmentsId200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_delete_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_delete_contact_db_list.go new file mode 100644 index 00000000..a8619196 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_delete_contact_db_list.go @@ -0,0 +1,111 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteContactDbListParam struct { + // + ListId *int32 `json:"list_id"` + // Adds the ability to delete all contacts on the list in addition to deleting the list. + DeleteContacts *DeleteContacts `json:"delete_contacts,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + Body *interface{} `json:"body,omitempty"` +} + +func (params *DeleteContactDbListParam) SetListId(ListId int32) *DeleteContactDbListParam { + params.ListId = &ListId + return params +} +func (params *DeleteContactDbListParam) SetDeleteContacts(DeleteContacts DeleteContacts) *DeleteContactDbListParam { + params.DeleteContacts = &DeleteContacts + return params +} +func (params *DeleteContactDbListParam) SetOnbehalfof(Onbehalfof string) *DeleteContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *DeleteContactDbListParam) SetBody(Body interface{}) *DeleteContactDbListParam { + params.Body = &Body + return params +} + +// **This endpoint allows you to delete a specific recipient list with the given ID.** +func (c *ApiService) DeleteContactDbList(params *DeleteContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists/{ListId}" + if params != nil && params.ListId != nil { + path = strings.Replace(path, "{"+"ListId"+"}", fmt.Sprint(*params.ListId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + if params != nil && params.DeleteContacts != nil { + data.Set("delete_contacts", fmt.Sprint(*params.DeleteContacts)) + } + body := []byte{} + if params != nil && params.Body != nil { + b, err := json.Marshal(*params.Body) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_delete_contact_db_lists.go b/rest/api/v3/lmc_contactdb/api_delete_contact_db_lists.go new file mode 100644 index 00000000..4eca4942 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_delete_contact_db_lists.go @@ -0,0 +1,82 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type DeleteContactDbListsParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + RequestBody *[]int32 `json:"request_body,omitempty"` +} + +func (params *DeleteContactDbListsParam) SetOnbehalfof(Onbehalfof string) *DeleteContactDbListsParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *DeleteContactDbListsParam) SetRequestBody(RequestBody []int32) *DeleteContactDbListsParam { + params.RequestBody = &RequestBody + return params +} + +// **This endpoint allows you to delete multiple recipient lists.** +func (c *ApiService) DeleteContactDbLists(params *DeleteContactDbListsParam) (interface{}, error) { + path := "/v3/contactdb/lists" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.RequestBody != nil { + b, err := json.Marshal(*params.RequestBody) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_delete_custom_field.go b/rest/api/v3/lmc_contactdb/api_delete_custom_field.go new file mode 100644 index 00000000..6922e534 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_delete_custom_field.go @@ -0,0 +1,95 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteCustomFieldParam struct { + // The ID of the custom field that you want to retrieve. + CustomFieldId *int32 `json:"custom_field_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteCustomFieldParam) SetCustomFieldId(CustomFieldId int32) *DeleteCustomFieldParam { + params.CustomFieldId = &CustomFieldId + return params +} +func (params *DeleteCustomFieldParam) SetOnbehalfof(Onbehalfof string) *DeleteCustomFieldParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a custom field by ID.** +func (c *ApiService) DeleteCustomField(params *DeleteCustomFieldParam) (interface{}, error) { + path := "/v3/contactdb/custom_fields/{CustomFieldId}" + if params != nil && params.CustomFieldId != nil { + path = strings.Replace(path, "{"+"CustomFieldId"+"}", fmt.Sprint(*params.CustomFieldId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_delete_recipient.go b/rest/api/v3/lmc_contactdb/api_delete_recipient.go new file mode 100644 index 00000000..ae613ae6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_delete_recipient.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteRecipientParam struct { + // The ID of the recipient that you want to retrieve. + RecipientId *string `json:"recipient_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteRecipientParam) SetRecipientId(RecipientId string) *DeleteRecipientParam { + params.RecipientId = &RecipientId + return params +} +func (params *DeleteRecipientParam) SetOnbehalfof(Onbehalfof string) *DeleteRecipientParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a single recipient with the given ID from your contact database.** > Use this to permanently delete your recipients from all of your contact lists and all segments if required by applicable law. +func (c *ApiService) DeleteRecipient(params *DeleteRecipientParam) (interface{}, error) { + path := "/v3/contactdb/recipients/{RecipientId}" + if params != nil && params.RecipientId != nil { + path = strings.Replace(path, "{"+"RecipientId"+"}", *params.RecipientId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_delete_recipient_from_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_delete_recipient_from_contact_db_list.go new file mode 100644 index 00000000..ef0e3b8b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_delete_recipient_from_contact_db_list.go @@ -0,0 +1,111 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteRecipientFromContactDbListParam struct { + // The ID of the list that you want to add the recipient to. + ListId *int32 `json:"list_id"` + // The ID of the recipient you are adding to the list. + RecipientId *string `json:"recipient_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + Body *interface{} `json:"body,omitempty"` +} + +func (params *DeleteRecipientFromContactDbListParam) SetListId(ListId int32) *DeleteRecipientFromContactDbListParam { + params.ListId = &ListId + return params +} +func (params *DeleteRecipientFromContactDbListParam) SetRecipientId(RecipientId string) *DeleteRecipientFromContactDbListParam { + params.RecipientId = &RecipientId + return params +} +func (params *DeleteRecipientFromContactDbListParam) SetOnbehalfof(Onbehalfof string) *DeleteRecipientFromContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *DeleteRecipientFromContactDbListParam) SetBody(Body interface{}) *DeleteRecipientFromContactDbListParam { + params.Body = &Body + return params +} + +// **This endpoint allows you to delete a single recipient from a list.** +func (c *ApiService) DeleteRecipientFromContactDbList(params *DeleteRecipientFromContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists/{ListId}/recipients/{RecipientId}" + if params != nil && params.ListId != nil { + path = strings.Replace(path, "{"+"ListId"+"}", fmt.Sprint(*params.ListId), -1) + } + if params != nil && params.RecipientId != nil { + path = strings.Replace(path, "{"+"RecipientId"+"}", *params.RecipientId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.Body != nil { + b, err := json.Marshal(*params.Body) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_delete_recipients.go b/rest/api/v3/lmc_contactdb/api_delete_recipients.go new file mode 100644 index 00000000..1789c0e9 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_delete_recipients.go @@ -0,0 +1,90 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type DeleteRecipientsParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + RequestBody *[]string `json:"request_body,omitempty"` +} + +func (params *DeleteRecipientsParam) SetOnbehalfof(Onbehalfof string) *DeleteRecipientsParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *DeleteRecipientsParam) SetRequestBody(RequestBody []string) *DeleteRecipientsParam { + params.RequestBody = &RequestBody + return params +} + +// **This endpoint allows you to deletes one or more recipients.** The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete. +func (c *ApiService) DeleteRecipients(params *DeleteRecipientsParam) (interface{}, error) { + path := "/v3/contactdb/recipients" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.RequestBody != nil { + b, err := json.Marshal(*params.RequestBody) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_delete_segment.go b/rest/api/v3/lmc_contactdb/api_delete_segment.go new file mode 100644 index 00000000..7c9c5d15 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_delete_segment.go @@ -0,0 +1,111 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteSegmentParam struct { + // + SegmentId *int32 `json:"segment_id"` + // True to delete all contacts matching the segment in addition to deleting the segment + DeleteContacts *bool `json:"delete_contacts,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + Body *interface{} `json:"body,omitempty"` +} + +func (params *DeleteSegmentParam) SetSegmentId(SegmentId int32) *DeleteSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *DeleteSegmentParam) SetDeleteContacts(DeleteContacts bool) *DeleteSegmentParam { + params.DeleteContacts = &DeleteContacts + return params +} +func (params *DeleteSegmentParam) SetOnbehalfof(Onbehalfof string) *DeleteSegmentParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *DeleteSegmentParam) SetBody(Body interface{}) *DeleteSegmentParam { + params.Body = &Body + return params +} + +// **This endpoint allows you to delete a segment from your recipients database.** You also have the option to delete all the contacts from your Marketing Campaigns recipient database who were in this segment. +func (c *ApiService) DeleteSegment(params *DeleteSegmentParam) (interface{}, error) { + path := "/v3/contactdb/segments/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", fmt.Sprint(*params.SegmentId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + if params != nil && params.DeleteContacts != nil { + data.Set("delete_contacts", fmt.Sprint(*params.DeleteContacts)) + } + body := []byte{} + if params != nil && params.Body != nil { + b, err := json.Marshal(*params.Body) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_get_billable.go b/rest/api/v3/lmc_contactdb/api_get_billable.go new file mode 100644 index 00000000..efe82e8b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_get_billable.go @@ -0,0 +1,67 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type GetBillableParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetBillableParam) SetOnbehalfof(Onbehalfof string) *GetBillableParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.** You are billed for marketing campaigns based on the highest number of recipients you have had in your account at one time. This endpoint will allow you to know the current billable count value. +func (c *ApiService) GetBillable(params *GetBillableParam) (interface{}, error) { + path := "/v3/contactdb/recipients/billable_count" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbRecipientCount200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_get_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_get_contact_db_list.go new file mode 100644 index 00000000..4ae1cd3c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_get_contact_db_list.go @@ -0,0 +1,95 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetContactDbListParam struct { + // + ListId *int32 `json:"list_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetContactDbListParam) SetListId(ListId int32) *GetContactDbListParam { + params.ListId = &ListId + return params +} +func (params *GetContactDbListParam) SetOnbehalfof(Onbehalfof string) *GetContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a single recipient list.** +func (c *ApiService) GetContactDbList(params *GetContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists/{ListId}" + if params != nil && params.ListId != nil { + path = strings.Replace(path, "{"+"ListId"+"}", fmt.Sprint(*params.ListId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbList2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_get_custom_field.go b/rest/api/v3/lmc_contactdb/api_get_custom_field.go new file mode 100644 index 00000000..b54e79b6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_get_custom_field.go @@ -0,0 +1,95 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetCustomFieldParam struct { + // The ID of the custom field that you want to retrieve. + CustomFieldId *int32 `json:"custom_field_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetCustomFieldParam) SetCustomFieldId(CustomFieldId int32) *GetCustomFieldParam { + params.CustomFieldId = &CustomFieldId + return params +} +func (params *GetCustomFieldParam) SetOnbehalfof(Onbehalfof string) *GetCustomFieldParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a custom field by ID.** +func (c *ApiService) GetCustomField(params *GetCustomFieldParam) (interface{}, error) { + path := "/v3/contactdb/custom_fields/{CustomFieldId}" + if params != nil && params.CustomFieldId != nil { + path = strings.Replace(path, "{"+"CustomFieldId"+"}", fmt.Sprint(*params.CustomFieldId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbCustomFieldId2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_get_recipient.go b/rest/api/v3/lmc_contactdb/api_get_recipient.go new file mode 100644 index 00000000..15be33fc --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_get_recipient.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetRecipientParam struct { + // The ID of the recipient that you want to retrieve. + RecipientId *string `json:"recipient_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetRecipientParam) SetRecipientId(RecipientId string) *GetRecipientParam { + params.RecipientId = &RecipientId + return params +} +func (params *GetRecipientParam) SetOnbehalfof(Onbehalfof string) *GetRecipientParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a single recipient by ID from your contact database.** +func (c *ApiService) GetRecipient(params *GetRecipientParam) (interface{}, error) { + path := "/v3/contactdb/recipients/{RecipientId}" + if params != nil && params.RecipientId != nil { + path = strings.Replace(path, "{"+"RecipientId"+"}", *params.RecipientId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbRecipient200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_get_recipient_list.go b/rest/api/v3/lmc_contactdb/api_get_recipient_list.go new file mode 100644 index 00000000..7bd02ed3 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_get_recipient_list.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetRecipientListParam struct { + // The ID of the recipient for whom you are retrieving lists. + RecipientId *string `json:"recipient_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetRecipientListParam) SetRecipientId(RecipientId string) *GetRecipientListParam { + params.RecipientId = &RecipientId + return params +} +func (params *GetRecipientListParam) SetOnbehalfof(Onbehalfof string) *GetRecipientListParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the lists that a given recipient belongs to.** Each recipient can be on many lists. This endpoint gives you all of the lists that any one recipient has been added to. +func (c *ApiService) GetRecipientList(params *GetRecipientListParam) (interface{}, error) { + path := "/v3/contactdb/recipients/{RecipientId}/lists" + if params != nil && params.RecipientId != nil { + path = strings.Replace(path, "{"+"RecipientId"+"}", *params.RecipientId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetRecipientList200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_get_segment.go b/rest/api/v3/lmc_contactdb/api_get_segment.go new file mode 100644 index 00000000..d9a2f56f --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_get_segment.go @@ -0,0 +1,95 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetSegmentParam struct { + // + SegmentId *int32 `json:"segment_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetSegmentParam) SetSegmentId(SegmentId int32) *GetSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *GetSegmentParam) SetOnbehalfof(Onbehalfof string) *GetSegmentParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a single segment with the given ID.** +func (c *ApiService) GetSegment(params *GetSegmentParam) (interface{}, error) { + path := "/v3/contactdb/segments/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", fmt.Sprint(*params.SegmentId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbSegments{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_list_contact_db_list.go new file mode 100644 index 00000000..4973479f --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_contact_db_list.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListContactDbListParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListContactDbListParam) SetOnbehalfof(Onbehalfof string) *ListContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of your recipient lists. If you don't have any lists, an empty array will be returned.** +func (c *ApiService) ListContactDbList(params *ListContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListAllListsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_custom_field.go b/rest/api/v3/lmc_contactdb/api_list_custom_field.go new file mode 100644 index 00000000..439cb1fe --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_custom_field.go @@ -0,0 +1,67 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListCustomFieldParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCustomFieldParam) SetOnbehalfof(Onbehalfof string) *ListCustomFieldParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all custom fields.** +func (c *ApiService) ListCustomField(params *ListCustomFieldParam) (interface{}, error) { + path := "/v3/contactdb/custom_fields" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListAllCustomFieldsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_recipient.go b/rest/api/v3/lmc_contactdb/api_list_recipient.go new file mode 100644 index 00000000..2d0cdbe0 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_recipient.go @@ -0,0 +1,95 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListRecipientParam struct { + // Page index of first recipients to return (must be a positive integer) + Page *int32 `json:"page,omitempty"` + // Number of recipients to return at a time (must be a positive integer between 1 and 1000) + PageSize *int32 `json:"page_size,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListRecipientParam) SetPage(Page int32) *ListRecipientParam { + params.Page = &Page + return params +} +func (params *ListRecipientParam) SetPageSize(PageSize int32) *ListRecipientParam { + params.PageSize = &PageSize + return params +} +func (params *ListRecipientParam) SetOnbehalfof(Onbehalfof string) *ListRecipientParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of your Marketing Campaigns recipients.** Batch deletion of a page makes it possible to receive an empty page of recipients before reaching the end of the list of recipients. To avoid this issue; iterate over pages until a 404 is retrieved. +func (c *ApiService) ListRecipient(params *ListRecipientParam) (interface{}, error) { + path := "/v3/contactdb/recipients" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Page != nil { + data.Set("page", fmt.Sprint(*params.Page)) + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListRecipientsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_recipient_count.go b/rest/api/v3/lmc_contactdb/api_list_recipient_count.go new file mode 100644 index 00000000..7f4e6d95 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_recipient_count.go @@ -0,0 +1,67 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListRecipientCountParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListRecipientCountParam) SetOnbehalfof(Onbehalfof string) *ListRecipientCountParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.** +func (c *ApiService) ListRecipientCount(params *ListRecipientCountParam) (interface{}, error) { + path := "/v3/contactdb/recipients/count" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbRecipientCount200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_recipient_for_segment.go b/rest/api/v3/lmc_contactdb/api_list_recipient_for_segment.go new file mode 100644 index 00000000..4fac33fc --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_recipient_for_segment.go @@ -0,0 +1,114 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ListRecipientForSegmentParam struct { + // The ID of the segment from which you want to retrieve recipients. + SegmentId *int32 `json:"segment_id"` + // + Page *int32 `json:"page,omitempty"` + // + PageSize *int32 `json:"page_size,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListRecipientForSegmentParam) SetSegmentId(SegmentId int32) *ListRecipientForSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *ListRecipientForSegmentParam) SetPage(Page int32) *ListRecipientForSegmentParam { + params.Page = &Page + return params +} +func (params *ListRecipientForSegmentParam) SetPageSize(PageSize int32) *ListRecipientForSegmentParam { + params.PageSize = &PageSize + return params +} +func (params *ListRecipientForSegmentParam) SetOnbehalfof(Onbehalfof string) *ListRecipientForSegmentParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of the recipients in a segment with the given ID.** +func (c *ApiService) ListRecipientForSegment(params *ListRecipientForSegmentParam) (interface{}, error) { + path := "/v3/contactdb/segments/{SegmentId}/recipients" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", fmt.Sprint(*params.SegmentId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Page != nil { + data.Set("page", fmt.Sprint(*params.Page)) + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListRecipientsOnASegmentResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_recipients_from_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_list_recipients_from_contact_db_list.go new file mode 100644 index 00000000..c52901f2 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_recipients_from_contact_db_list.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ListRecipientsFromContactDbListParam struct { + // The id of the list of recipients you want to retrieve. + ListId *int32 `json:"list_id"` + // Page index of first recipient to return (must be a positive integer) + Page *int32 `json:"page,omitempty"` + // Number of recipients to return at a time (must be a positive integer between 1 and 1000) + PageSize *int32 `json:"page_size,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListRecipientsFromContactDbListParam) SetListId(ListId int32) *ListRecipientsFromContactDbListParam { + params.ListId = &ListId + return params +} +func (params *ListRecipientsFromContactDbListParam) SetPage(Page int32) *ListRecipientsFromContactDbListParam { + params.Page = &Page + return params +} +func (params *ListRecipientsFromContactDbListParam) SetPageSize(PageSize int32) *ListRecipientsFromContactDbListParam { + params.PageSize = &PageSize + return params +} +func (params *ListRecipientsFromContactDbListParam) SetOnbehalfof(Onbehalfof string) *ListRecipientsFromContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all recipients on the list with the given ID.** +func (c *ApiService) ListRecipientsFromContactDbList(params *ListRecipientsFromContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists/{ListId}/recipients" + if params != nil && params.ListId != nil { + path = strings.Replace(path, "{"+"ListId"+"}", fmt.Sprint(*params.ListId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Page != nil { + data.Set("page", fmt.Sprint(*params.Page)) + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListRecipientsFromContactDbList200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_reserved_field.go b/rest/api/v3/lmc_contactdb/api_list_reserved_field.go new file mode 100644 index 00000000..080d2d83 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_reserved_field.go @@ -0,0 +1,67 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListReservedFieldParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListReservedFieldParam) SetOnbehalfof(Onbehalfof string) *ListReservedFieldParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to list all fields that are reserved and can't be used for custom field names.** +func (c *ApiService) ListReservedField(params *ListReservedFieldParam) (interface{}, error) { + path := "/v3/contactdb/reserved_fields" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListReservedField200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_search_recipient.go b/rest/api/v3/lmc_contactdb/api_list_search_recipient.go new file mode 100644 index 00000000..3cae2eea --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_search_recipient.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListSearchRecipientParam struct { + // + FieldName *string `json:"{field_name},omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListSearchRecipientParam) SetFieldName(FieldName string) *ListSearchRecipientParam { + params.FieldName = &FieldName + return params +} +func (params *ListSearchRecipientParam) SetOnbehalfof(Onbehalfof string) *ListSearchRecipientParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.** field_name: * is a variable that is substituted for your actual custom field name from your recipient. * Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200) * If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through Mon, 02 Feb 2015 23:59:59 GMT. +func (c *ApiService) ListSearchRecipient(params *ListSearchRecipientParam) (interface{}, error) { + path := "/v3/contactdb/recipients/search" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.FieldName != nil { + data.Set("{field_name}", *params.FieldName) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListRecipientsFromContactDbList200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_segment.go b/rest/api/v3/lmc_contactdb/api_list_segment.go new file mode 100644 index 00000000..9e71d3c2 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_segment.go @@ -0,0 +1,67 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListSegmentParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListSegmentParam) SetOnbehalfof(Onbehalfof string) *ListSegmentParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of your segments.** +func (c *ApiService) ListSegment(params *ListSegmentParam) (interface{}, error) { + path := "/v3/contactdb/segments" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListAllSegmentsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_list_status.go b/rest/api/v3/lmc_contactdb/api_list_status.go new file mode 100644 index 00000000..08180a42 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_list_status.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListStatusParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListStatusParam) SetOnbehalfof(Onbehalfof string) *ListStatusParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to check the upload status of a Marketing Campaigns recipient.** +func (c *ApiService) ListStatus(params *ListStatusParam) (interface{}, error) { + path := "/v3/contactdb/status" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListStatus200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_search_recipient.go b/rest/api/v3/lmc_contactdb/api_search_recipient.go new file mode 100644 index 00000000..810296ef --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_search_recipient.go @@ -0,0 +1,65 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type SearchRecipientParam struct { + // + SearchRecipientRequest *SearchRecipientRequest `json:"SearchRecipientRequest,omitempty"` +} + +func (params *SearchRecipientParam) SetSearchRecipientRequest(SearchRecipientRequest SearchRecipientRequest) *SearchRecipientParam { + params.SearchRecipientRequest = &SearchRecipientRequest + return params +} + +// Search using segment conditions without actually creating a segment. Body contains a JSON object with `conditions`, a list of conditions as described below, and an optional `list_id`, which is a valid list ID for a list to limit the search on. Valid operators for create and update depend on the type of the field for which you are searching. - Dates: - `\"eq\"`, `\"ne\"`, `\"lt\"` (before), `\"gt\"` (after) - You may use MM/DD/YYYY for day granularity or an epoch for second granularity. - `\"empty\"`, `\"not_empty\"` - `\"is within\"` - You may use an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date format or the # of days. - Text: `\"contains\"`, `\"eq\"` (is - matches the full field), `\"ne\"` (is not - matches any field where the entire field is not the condition value), `\"empty\"`, `\"not_empty\"` - Numbers: `\"eq\"`, `\"lt\"`, `\"gt\"`, `\"empty\"`, `\"not_empty\"` - Email Clicks and Opens: `\"eq\"` (opened), `\"ne\"` (not opened) Field values must all be a string. Search conditions using `\"eq\"` or `\"ne\"` for email clicks and opens should provide a \"field\" of either `clicks.campaign_identifier` or `opens.campaign_identifier`. The condition value should be a string containing the id of a completed campaign. Search conditions list may contain multiple conditions, joined by an `\"and\"` or `\"or\"` in the `\"and_or\"` field. The first condition in the conditions list must have an empty `\"and_or\"`, and subsequent conditions must all specify an `\"and_or\"`. +func (c *ApiService) SearchRecipient(params *SearchRecipientParam) (interface{}, error) { + path := "/v3/contactdb/recipients/search" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SearchRecipientRequest != nil { + b, err := json.Marshal(*params.SearchRecipientRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SearchRecipient200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_service.go b/rest/api/v3/lmc_contactdb/api_service.go new file mode 100644 index 00000000..47aac07a --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/lmc_contactdb/api_update_contact_db_list.go b/rest/api/v3/lmc_contactdb/api_update_contact_db_list.go new file mode 100644 index 00000000..f4e48e57 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_update_contact_db_list.go @@ -0,0 +1,102 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateContactDbListParam struct { + // + ListId *int32 `json:"list_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateAListRequest *UpdateAListRequest `json:"UpdateAListRequest,omitempty"` +} + +func (params *UpdateContactDbListParam) SetListId(ListId int32) *UpdateContactDbListParam { + params.ListId = &ListId + return params +} +func (params *UpdateContactDbListParam) SetOnbehalfof(Onbehalfof string) *UpdateContactDbListParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateContactDbListParam) SetUpdateAListRequest(UpdateAListRequest UpdateAListRequest) *UpdateContactDbListParam { + params.UpdateAListRequest = &UpdateAListRequest + return params +} + +// **This endpoint allows you to update the name of one of your recipient lists.** +func (c *ApiService) UpdateContactDbList(params *UpdateContactDbListParam) (interface{}, error) { + path := "/v3/contactdb/lists/{ListId}" + if params != nil && params.ListId != nil { + path = strings.Replace(path, "{"+"ListId"+"}", fmt.Sprint(*params.ListId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateAListRequest != nil { + b, err := json.Marshal(*params.UpdateAListRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateContactDbList200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_update_recipient.go b/rest/api/v3/lmc_contactdb/api_update_recipient.go new file mode 100644 index 00000000..ccb7fa86 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_update_recipient.go @@ -0,0 +1,90 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateRecipientParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateRecipientRequestInner *[]UpdateRecipientRequestInner `json:"UpdateRecipientRequestInner,omitempty"` +} + +func (params *UpdateRecipientParam) SetOnbehalfof(Onbehalfof string) *UpdateRecipientParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateRecipientParam) SetUpdateRecipientRequestInner(UpdateRecipientRequestInner []UpdateRecipientRequestInner) *UpdateRecipientParam { + params.UpdateRecipientRequestInner = &UpdateRecipientRequestInner + return params +} + +// **This endpoint allows you to update one or more recipients.** The body of an API call to this endpoint must include an array of one or more recipient objects. It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides. +func (c *ApiService) UpdateRecipient(params *UpdateRecipientParam) (interface{}, error) { + path := "/v3/contactdb/recipients" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateRecipientRequestInner != nil { + b, err := json.Marshal(*params.UpdateRecipientRequestInner) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ContactdbRecipientResponse201{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/api_update_segment.go b/rest/api/v3/lmc_contactdb/api_update_segment.go new file mode 100644 index 00000000..d5023966 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/api_update_segment.go @@ -0,0 +1,102 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateSegmentParam struct { + // + SegmentId *int32 `json:"segment_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateSegmentRequest *UpdateSegmentRequest `json:"UpdateSegmentRequest,omitempty"` +} + +func (params *UpdateSegmentParam) SetSegmentId(SegmentId int32) *UpdateSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *UpdateSegmentParam) SetOnbehalfof(Onbehalfof string) *UpdateSegmentParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateSegmentParam) SetUpdateSegmentRequest(UpdateSegmentRequest UpdateSegmentRequest) *UpdateSegmentParam { + params.UpdateSegmentRequest = &UpdateSegmentRequest + return params +} + +// **This endpoint allows you to update a segment.** +func (c *ApiService) UpdateSegment(params *UpdateSegmentParam) (interface{}, error) { + path := "/v3/contactdb/segments/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", fmt.Sprint(*params.SegmentId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateSegmentRequest != nil { + b, err := json.Marshal(*params.UpdateSegmentRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ContactdbSegments{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_contactdb/docs/AddRecipient.md b/rest/api/v3/lmc_contactdb/docs/AddRecipient.md new file mode 100644 index 00000000..9bb1614c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/AddRecipient.md @@ -0,0 +1,49 @@ +# AddRecipient + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddRecipient**](AddRecipient.md#AddRecipient) | **Post** /v3/contactdb/recipients | Add recipients + + + +## AddRecipient + +> ContactdbRecipientResponse201 AddRecipient(ctx, optional) + +Add recipients + +**This endpoint allows you to add a Marketing Campaigns recipient.** You can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides. The rate limit is three requests every 2 seconds. You can upload 1000 contacts per request. So the maximum upload rate is 1500 recipients per second. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a AddRecipientParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**AddRecipientRequestInner** | [**[]AddRecipientRequestInner**](AddRecipientRequestInner.md) | + +### Return type + +[**ContactdbRecipientResponse201**](ContactdbRecipientResponse201.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/AddRecipientRequestInner.md b/rest/api/v3/lmc_contactdb/docs/AddRecipientRequestInner.md new file mode 100644 index 00000000..3860b0d0 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/AddRecipientRequestInner.md @@ -0,0 +1,14 @@ +# AddRecipientRequestInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address of the recipient. | +**FirstName** | **string** | The first name of the recipient. |[optional] +**LastName** | **string** | The last name of the recipient. |[optional] +**Age** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/AddRecipientToContactDbList.md b/rest/api/v3/lmc_contactdb/docs/AddRecipientToContactDbList.md new file mode 100644 index 00000000..0a1cbd6c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/AddRecipientToContactDbList.md @@ -0,0 +1,53 @@ +# AddRecipientToContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddRecipientToContactDbList**](AddRecipientToContactDbList.md#AddRecipientToContactDbList) | **Post** /v3/contactdb/lists/{ListId}/recipients/{RecipientId} | Add a Single Recipient to a List + + + +## AddRecipientToContactDbList + +> interface{} AddRecipientToContactDbList(ctx, ListIdRecipientIdoptional) + +Add a Single Recipient to a List + +**This endpoint allows you to add a single recipient to a list.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ListId** | **int32** | The ID of the list that you want to add the recipient to. +**RecipientId** | **string** | The ID of the recipient you are adding to the list. + +### Other Parameters + +Other parameters are passed through a pointer to a AddRecipientToContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/AddRecipientsToContactDbList.md b/rest/api/v3/lmc_contactdb/docs/AddRecipientsToContactDbList.md new file mode 100644 index 00000000..4e67a243 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/AddRecipientsToContactDbList.md @@ -0,0 +1,53 @@ +# AddRecipientsToContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddRecipientsToContactDbList**](AddRecipientsToContactDbList.md#AddRecipientsToContactDbList) | **Post** /v3/contactdb/lists/{ListId}/recipients | Add Multiple Recipients to a List + + + +## AddRecipientsToContactDbList + +> interface{} AddRecipientsToContactDbList(ctx, ListIdoptional) + +Add Multiple Recipients to a List + +**This endpoint allows you to add multiple recipients to a list.** Adds existing recipients to a list, passing in the recipient IDs to add. Recipient IDs (base64-encoded email addresses) should be passed exactly as they are returned from recipient endpoints. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ListId** | **int32** | The id of the list of recipients you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a AddRecipientsToContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**RequestBody** | **[]string** | + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/AndOr.md b/rest/api/v3/lmc_contactdb/docs/AndOr.md new file mode 100644 index 00000000..acf7be53 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/AndOr.md @@ -0,0 +1,14 @@ +# AndOr + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**AND** | string | (value: `"and"`) +**OR** | string | (value: `"or"`) +**EMPTY** | string | (value: `""`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbCustomField.md b/rest/api/v3/lmc_contactdb/docs/ContactdbCustomField.md new file mode 100644 index 00000000..d152b843 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbCustomField.md @@ -0,0 +1,12 @@ +# ContactdbCustomField + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the field |[optional] +**Type** | [**Type**](Type.md) | The type of the field. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldId2xx.md b/rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldId2xx.md new file mode 100644 index 00000000..c8223d54 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldId2xx.md @@ -0,0 +1,13 @@ +# ContactdbCustomFieldId2xx + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the field |[optional] +**Type** | [**Type**](Type.md) | The type of the field. |[optional] +**Id** | **float32** | The ID of the custom field. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldIdValue.md b/rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldIdValue.md new file mode 100644 index 00000000..411b325c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbCustomFieldIdValue.md @@ -0,0 +1,14 @@ +# ContactdbCustomFieldIdValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the field |[optional] +**Type** | [**Type**](Type.md) | The type of the field. |[optional] +**Id** | **float32** | The ID of the custom field. |[optional] +**Value** | **string** | The value of this recipient's custom field |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbList2xx.md b/rest/api/v3/lmc_contactdb/docs/ContactdbList2xx.md new file mode 100644 index 00000000..ce51cebb --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbList2xx.md @@ -0,0 +1,13 @@ +# ContactdbList2xx + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The reference ID of your list. | +**Name** | **string** | The name of your list. Must be unique against all other list and segment names. | +**RecipientCount** | **int32** | The count of recipients currently in the list. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200.md b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200.md new file mode 100644 index 00000000..b07a679b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200.md @@ -0,0 +1,11 @@ +# ContactdbRecipient200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Recipients** | [**[]ContactdbRecipient200RecipientsInner**](ContactdbRecipient200RecipientsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200RecipientsInner.md b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200RecipientsInner.md new file mode 100644 index 00000000..8ec7cf16 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipient200RecipientsInner.md @@ -0,0 +1,20 @@ +# ContactdbRecipient200RecipientsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of this recipient. |[optional] +**CreatedAt** | **float32** | The time this record was created in your contactdb, in unixtime. |[optional] +**CustomFields** | [**[]ContactdbCustomFieldIdValue**](ContactdbCustomFieldIdValue.md) | The custom fields assigned to this recipient and their values. |[optional] +**Email** | **string** | The email address of this recipient. This is a default custom field that SendGrid provides. | +**FirstName** | **string** | The first name of this recipient. This is a default custom field that SendGrid provides. |[optional] +**LastName** | **string** | The last name of the recipient. |[optional] +**LastClicked** | **float32** | The last time this recipient clicked a link from one of your campaigns, in unixtime. |[optional] +**LastEmailed** | **float32** | The last time this user was emailed by one of your campaigns, in unixtime. |[optional] +**LastOpened** | **float32** | The last time this recipient opened an email from you, in unixtime. |[optional] +**UpdatedAt** | **float32** | The last update date for this recipient's record. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientCount200.md b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientCount200.md new file mode 100644 index 00000000..3a605dbc --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientCount200.md @@ -0,0 +1,11 @@ +# ContactdbRecipientCount200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RecipientCount** | **float32** | The count of recipients. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201.md b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201.md new file mode 100644 index 00000000..f5b31dc6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201.md @@ -0,0 +1,16 @@ +# ContactdbRecipientResponse201 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ErrorCount** | **float32** | The number of errors found while adding recipients. |[default to 0] +**ErrorIndices** | **[]float32** | The indices of the recipient(s) sent that caused the error. |[optional] [default to []] +**NewCount** | **float32** | The count of new recipients added to the contactdb. |[default to 0] +**PersistedRecipients** | **[]string** | The recipient IDs of the recipients that already existed from this request. |[default to []] +**UpdatedCount** | **float32** | The recipients who were updated from this request. |[default to 0] +**Errors** | [**[]ContactdbRecipientResponse201ErrorsInner**](ContactdbRecipientResponse201ErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201ErrorsInner.md b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201ErrorsInner.md new file mode 100644 index 00000000..d7994f83 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbRecipientResponse201ErrorsInner.md @@ -0,0 +1,12 @@ +# ContactdbRecipientResponse201ErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**ErrorIndices** | **[]float32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbSegments.md b/rest/api/v3/lmc_contactdb/docs/ContactdbSegments.md new file mode 100644 index 00000000..c9573dfd --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbSegments.md @@ -0,0 +1,14 @@ +# ContactdbSegments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of this segment. | +**ListId** | **int32** | The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list. |[optional] +**Conditions** | [**[]ContactdbSegmentsConditions**](ContactdbSegmentsConditions.md) | The conditions for a recipient to be included in this segment. | +**RecipientCount** | **float32** | The count of recipients in this list. This is not included on creation of segments. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsConditions.md b/rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsConditions.md new file mode 100644 index 00000000..0cac8eb2 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsConditions.md @@ -0,0 +1,14 @@ +# ContactdbSegmentsConditions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | | +**Value** | **string** | | +**Operator** | [**Operator**](Operator.md) | | +**AndOr** | [**AndOr**](AndOr.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsId200.md b/rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsId200.md new file mode 100644 index 00000000..8e94dfe6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ContactdbSegmentsId200.md @@ -0,0 +1,15 @@ +# ContactdbSegmentsId200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **float32** | The ID of the segment. | +**Name** | **string** | The name of this segment. | +**ListId** | **int32** | The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list. |[optional] +**Conditions** | [**[]ContactdbSegmentsConditions**](ContactdbSegmentsConditions.md) | The conditions for a recipient to be included in this segment. | +**RecipientCount** | **float32** | The count of recipients in this list. This is not included on creation of segments. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/CreateAListRequest.md b/rest/api/v3/lmc_contactdb/docs/CreateAListRequest.md new file mode 100644 index 00000000..0657b896 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/CreateAListRequest.md @@ -0,0 +1,11 @@ +# CreateAListRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/CreateContactDbList.md b/rest/api/v3/lmc_contactdb/docs/CreateContactDbList.md new file mode 100644 index 00000000..e513375e --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/CreateContactDbList.md @@ -0,0 +1,49 @@ +# CreateContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateContactDbList**](CreateContactDbList.md#CreateContactDbList) | **Post** /v3/contactdb/lists | Create a List + + + +## CreateContactDbList + +> ContactdbList2xx CreateContactDbList(ctx, optional) + +Create a List + +**This endpoint allows you to create a list for your recipients.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateAListRequest** | [**CreateAListRequest**](CreateAListRequest.md) | + +### Return type + +[**ContactdbList2xx**](ContactdbList2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/CreateCustomField.md b/rest/api/v3/lmc_contactdb/docs/CreateCustomField.md new file mode 100644 index 00000000..6e9ca61e --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/CreateCustomField.md @@ -0,0 +1,49 @@ +# CreateCustomField + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateCustomField**](CreateCustomField.md#CreateCustomField) | **Post** /v3/contactdb/custom_fields | Create a Custom Field + + + +## CreateCustomField + +> ContactdbCustomFieldId2xx CreateCustomField(ctx, optional) + +Create a Custom Field + +**This endpoint allows you to create a custom field.** **You can create up to 120 custom fields.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateCustomFieldParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateCustomFieldRequest** | [**CreateCustomFieldRequest**](CreateCustomFieldRequest.md) | + +### Return type + +[**ContactdbCustomFieldId2xx**](ContactdbCustomFieldId2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/CreateCustomFieldRequest.md b/rest/api/v3/lmc_contactdb/docs/CreateCustomFieldRequest.md new file mode 100644 index 00000000..7254d6af --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/CreateCustomFieldRequest.md @@ -0,0 +1,12 @@ +# CreateCustomFieldRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | |[optional] +**Type** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/CreateSegment.md b/rest/api/v3/lmc_contactdb/docs/CreateSegment.md new file mode 100644 index 00000000..4019fb85 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/CreateSegment.md @@ -0,0 +1,49 @@ +# CreateSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSegment**](CreateSegment.md#CreateSegment) | **Post** /v3/contactdb/segments | Create a Segment + + + +## CreateSegment + +> ContactdbSegmentsId200 CreateSegment(ctx, optional) + +Create a Segment + +**This endpoint allows you to create a new segment.** Valid operators for create and update depend on the type of the field for which you are searching. **Dates** - \"eq\", \"ne\", \"lt\" (before), \"gt\" (after) - You may use MM/DD/YYYY for day granularity or an epoch for second granularity. - \"empty\", \"not_empty\" - \"is within\" - You may use an [ISO 8601 date format](https://en.wikipedia.org/wiki/ISO_8601) or the # of days. **Text** - \"contains\" - \"eq\" (is/equals - matches the full field) - \"ne\" (is not/not equals - matches any field where the entire field is not the condition value) - \"empty\" - \"not_empty\" **Numbers** - \"eq\" (is/equals) - \"lt\" (is less than) - \"gt\" (is greater than) - \"empty\" - \"not_empty\" **Email Clicks and Opens** - \"eq\" (opened) - \"ne\" (not opened) All field values must be a string. Conditions using \"eq\" or \"ne\" for email clicks and opens should provide a \"field\" of either `clicks.campaign_identifier` or `opens.campaign_identifier`. The condition value should be a string containing the id of a completed campaign. The conditions list may contain multiple conditions, joined by an \"and\" or \"or\" in the \"and_or\" field. The first condition in the conditions list must have an empty \"and_or\", and subsequent conditions must all specify an \"and_or\". + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**ContactdbSegments** | [**ContactdbSegments**](ContactdbSegments.md) | + +### Return type + +[**ContactdbSegmentsId200**](ContactdbSegmentsId200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteContactDbList.md b/rest/api/v3/lmc_contactdb/docs/DeleteContactDbList.md new file mode 100644 index 00000000..23af3f29 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteContactDbList.md @@ -0,0 +1,54 @@ +# DeleteContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteContactDbList**](DeleteContactDbList.md#DeleteContactDbList) | **Delete** /v3/contactdb/lists/{ListId} | Delete a List + + + +## DeleteContactDbList + +> interface{} DeleteContactDbList(ctx, ListIdoptional) + +Delete a List + +**This endpoint allows you to delete a specific recipient list with the given ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ListId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DeleteContacts** | [**DeleteContacts**](DeleteContactsDeleteContacts.md) | Adds the ability to delete all contacts on the list in addition to deleting the list. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Body** | **interface{}** | + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteContactDbLists.md b/rest/api/v3/lmc_contactdb/docs/DeleteContactDbLists.md new file mode 100644 index 00000000..9f510860 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteContactDbLists.md @@ -0,0 +1,49 @@ +# DeleteContactDbLists + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteContactDbLists**](DeleteContactDbLists.md#DeleteContactDbLists) | **Delete** /v3/contactdb/lists | Delete Multiple lists + + + +## DeleteContactDbLists + +> interface{} DeleteContactDbLists(ctx, optional) + +Delete Multiple lists + +**This endpoint allows you to delete multiple recipient lists.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteContactDbListsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**RequestBody** | **[]int32** | + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteContacts.md b/rest/api/v3/lmc_contactdb/docs/DeleteContacts.md new file mode 100644 index 00000000..46341479 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteContacts.md @@ -0,0 +1,13 @@ +# DeleteContacts + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteCustomField.md b/rest/api/v3/lmc_contactdb/docs/DeleteCustomField.md new file mode 100644 index 00000000..7e69ff8f --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteCustomField.md @@ -0,0 +1,52 @@ +# DeleteCustomField + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteCustomField**](DeleteCustomField.md#DeleteCustomField) | **Delete** /v3/contactdb/custom_fields/{CustomFieldId} | Delete a Custom Field + + + +## DeleteCustomField + +> ErrorResponse DeleteCustomField(ctx, CustomFieldIdoptional) + +Delete a Custom Field + +**This endpoint allows you to delete a custom field by ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CustomFieldId** | **int32** | The ID of the custom field that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteCustomFieldParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ErrorResponse**](ErrorResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteRecipient.md b/rest/api/v3/lmc_contactdb/docs/DeleteRecipient.md new file mode 100644 index 00000000..58d9ecb7 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteRecipient.md @@ -0,0 +1,52 @@ +# DeleteRecipient + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteRecipient**](DeleteRecipient.md#DeleteRecipient) | **Delete** /v3/contactdb/recipients/{RecipientId} | Delete a Recipient + + + +## DeleteRecipient + +> map[string]interface{} DeleteRecipient(ctx, RecipientIdoptional) + +Delete a Recipient + +**This endpoint allows you to delete a single recipient with the given ID from your contact database.** > Use this to permanently delete your recipients from all of your contact lists and all segments if required by applicable law. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**RecipientId** | **string** | The ID of the recipient that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteRecipientParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteRecipientFromContactDbList.md b/rest/api/v3/lmc_contactdb/docs/DeleteRecipientFromContactDbList.md new file mode 100644 index 00000000..250be368 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteRecipientFromContactDbList.md @@ -0,0 +1,54 @@ +# DeleteRecipientFromContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteRecipientFromContactDbList**](DeleteRecipientFromContactDbList.md#DeleteRecipientFromContactDbList) | **Delete** /v3/contactdb/lists/{ListId}/recipients/{RecipientId} | Delete a Single Recipient from a Single List + + + +## DeleteRecipientFromContactDbList + +> interface{} DeleteRecipientFromContactDbList(ctx, ListIdRecipientIdoptional) + +Delete a Single Recipient from a Single List + +**This endpoint allows you to delete a single recipient from a list.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ListId** | **int32** | The ID of the list that you want to add the recipient to. +**RecipientId** | **string** | The ID of the recipient you are adding to the list. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteRecipientFromContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Body** | **interface{}** | + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteRecipients.md b/rest/api/v3/lmc_contactdb/docs/DeleteRecipients.md new file mode 100644 index 00000000..69fe918f --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteRecipients.md @@ -0,0 +1,49 @@ +# DeleteRecipients + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteRecipients**](DeleteRecipients.md#DeleteRecipients) | **Delete** /v3/contactdb/recipients | Delete Recipients + + + +## DeleteRecipients + +> map[string]interface{} DeleteRecipients(ctx, optional) + +Delete Recipients + +**This endpoint allows you to deletes one or more recipients.** The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteRecipientsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**RequestBody** | **[]string** | + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/DeleteSegment.md b/rest/api/v3/lmc_contactdb/docs/DeleteSegment.md new file mode 100644 index 00000000..fbda5503 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/DeleteSegment.md @@ -0,0 +1,54 @@ +# DeleteSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSegment**](DeleteSegment.md#DeleteSegment) | **Delete** /v3/contactdb/segments/{SegmentId} | Delete a segment + + + +## DeleteSegment + +> interface{} DeleteSegment(ctx, SegmentIdoptional) + +Delete a segment + +**This endpoint allows you to delete a segment from your recipients database.** You also have the option to delete all the contacts from your Marketing Campaigns recipient database who were in this segment. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DeleteContacts** | **bool** | True to delete all contacts matching the segment in addition to deleting the segment +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Body** | **interface{}** | + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ErrorResponse.md b/rest/api/v3/lmc_contactdb/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ErrorResponseErrorsInner.md b/rest/api/v3/lmc_contactdb/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/GetBillable.md b/rest/api/v3/lmc_contactdb/docs/GetBillable.md new file mode 100644 index 00000000..ec9018ef --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/GetBillable.md @@ -0,0 +1,48 @@ +# GetBillable + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetBillable**](GetBillable.md#GetBillable) | **Get** /v3/contactdb/recipients/billable_count | Retrieve the count of billable recipients + + + +## GetBillable + +> ContactdbRecipientCount200 GetBillable(ctx, optional) + +Retrieve the count of billable recipients + +**This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.** You are billed for marketing campaigns based on the highest number of recipients you have had in your account at one time. This endpoint will allow you to know the current billable count value. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a GetBillableParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ContactdbRecipientCount200**](ContactdbRecipientCount200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/GetContactDbList.md b/rest/api/v3/lmc_contactdb/docs/GetContactDbList.md new file mode 100644 index 00000000..c7814353 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/GetContactDbList.md @@ -0,0 +1,52 @@ +# GetContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetContactDbList**](GetContactDbList.md#GetContactDbList) | **Get** /v3/contactdb/lists/{ListId} | Retrieve a single list + + + +## GetContactDbList + +> ContactdbList2xx GetContactDbList(ctx, ListIdoptional) + +Retrieve a single list + +**This endpoint allows you to retrieve a single recipient list.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ListId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ContactdbList2xx**](ContactdbList2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/GetCustomField.md b/rest/api/v3/lmc_contactdb/docs/GetCustomField.md new file mode 100644 index 00000000..9f0bd912 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/GetCustomField.md @@ -0,0 +1,52 @@ +# GetCustomField + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetCustomField**](GetCustomField.md#GetCustomField) | **Get** /v3/contactdb/custom_fields/{CustomFieldId} | Retrieve a Custom Field + + + +## GetCustomField + +> ContactdbCustomFieldId2xx GetCustomField(ctx, CustomFieldIdoptional) + +Retrieve a Custom Field + +**This endpoint allows you to retrieve a custom field by ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CustomFieldId** | **int32** | The ID of the custom field that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetCustomFieldParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ContactdbCustomFieldId2xx**](ContactdbCustomFieldId2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/GetRecipient.md b/rest/api/v3/lmc_contactdb/docs/GetRecipient.md new file mode 100644 index 00000000..e4908f98 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/GetRecipient.md @@ -0,0 +1,52 @@ +# GetRecipient + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetRecipient**](GetRecipient.md#GetRecipient) | **Get** /v3/contactdb/recipients/{RecipientId} | Retrieve a single recipient + + + +## GetRecipient + +> ContactdbRecipient200 GetRecipient(ctx, RecipientIdoptional) + +Retrieve a single recipient + +**This endpoint allows you to retrieve a single recipient by ID from your contact database.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**RecipientId** | **string** | The ID of the recipient that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetRecipientParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ContactdbRecipient200**](ContactdbRecipient200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/GetRecipientList.md b/rest/api/v3/lmc_contactdb/docs/GetRecipientList.md new file mode 100644 index 00000000..23c85802 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/GetRecipientList.md @@ -0,0 +1,52 @@ +# GetRecipientList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetRecipientList**](GetRecipientList.md#GetRecipientList) | **Get** /v3/contactdb/recipients/{RecipientId}/lists | Retrieve the lists that a recipient is on + + + +## GetRecipientList + +> GetRecipientList200Response GetRecipientList(ctx, RecipientIdoptional) + +Retrieve the lists that a recipient is on + +**This endpoint allows you to retrieve the lists that a given recipient belongs to.** Each recipient can be on many lists. This endpoint gives you all of the lists that any one recipient has been added to. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**RecipientId** | **string** | The ID of the recipient for whom you are retrieving lists. + +### Other Parameters + +Other parameters are passed through a pointer to a GetRecipientListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GetRecipientList200Response**](GetRecipientList200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/GetRecipientList200Response.md b/rest/api/v3/lmc_contactdb/docs/GetRecipientList200Response.md new file mode 100644 index 00000000..ff8b2268 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/GetRecipientList200Response.md @@ -0,0 +1,11 @@ +# GetRecipientList200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Lists** | [**[]ContactdbList2xx**](ContactdbList2xx.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/GetSegment.md b/rest/api/v3/lmc_contactdb/docs/GetSegment.md new file mode 100644 index 00000000..c6d62133 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/GetSegment.md @@ -0,0 +1,52 @@ +# GetSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSegment**](GetSegment.md#GetSegment) | **Get** /v3/contactdb/segments/{SegmentId} | Retrieve a segment + + + +## GetSegment + +> ContactdbSegments GetSegment(ctx, SegmentIdoptional) + +Retrieve a segment + +**This endpoint allows you to retrieve a single segment with the given ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ContactdbSegments**](ContactdbSegments.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListAllCustomFieldsResponse.md b/rest/api/v3/lmc_contactdb/docs/ListAllCustomFieldsResponse.md new file mode 100644 index 00000000..58fabba7 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListAllCustomFieldsResponse.md @@ -0,0 +1,11 @@ +# ListAllCustomFieldsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomFields** | [**[]ContactdbCustomFieldId2xx**](ContactdbCustomFieldId2xx.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListAllListsResponse.md b/rest/api/v3/lmc_contactdb/docs/ListAllListsResponse.md new file mode 100644 index 00000000..c94eff0b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListAllListsResponse.md @@ -0,0 +1,11 @@ +# ListAllListsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Lists** | [**[]ContactdbList2xx**](ContactdbList2xx.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListAllSegmentsResponse.md b/rest/api/v3/lmc_contactdb/docs/ListAllSegmentsResponse.md new file mode 100644 index 00000000..1d8fc71c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListAllSegmentsResponse.md @@ -0,0 +1,11 @@ +# ListAllSegmentsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Segments** | [**[]ContactdbSegments**](ContactdbSegments.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListContactDbList.md b/rest/api/v3/lmc_contactdb/docs/ListContactDbList.md new file mode 100644 index 00000000..d0a72af7 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListContactDbList.md @@ -0,0 +1,48 @@ +# ListContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListContactDbList**](ListContactDbList.md#ListContactDbList) | **Get** /v3/contactdb/lists | Retrieve all lists + + + +## ListContactDbList + +> ListAllListsResponse ListContactDbList(ctx, optional) + +Retrieve all lists + +**This endpoint allows you to retrieve all of your recipient lists. If you don't have any lists, an empty array will be returned.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListAllListsResponse**](ListAllListsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListCustomField.md b/rest/api/v3/lmc_contactdb/docs/ListCustomField.md new file mode 100644 index 00000000..d6450a9d --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListCustomField.md @@ -0,0 +1,48 @@ +# ListCustomField + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCustomField**](ListCustomField.md#ListCustomField) | **Get** /v3/contactdb/custom_fields | Retrieve all custom fields + + + +## ListCustomField + +> ListAllCustomFieldsResponse ListCustomField(ctx, optional) + +Retrieve all custom fields + +**This endpoint allows you to retrieve all custom fields.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCustomFieldParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListAllCustomFieldsResponse**](ListAllCustomFieldsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListRecipient.md b/rest/api/v3/lmc_contactdb/docs/ListRecipient.md new file mode 100644 index 00000000..614b17ca --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListRecipient.md @@ -0,0 +1,50 @@ +# ListRecipient + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListRecipient**](ListRecipient.md#ListRecipient) | **Get** /v3/contactdb/recipients | Retrieve recipients + + + +## ListRecipient + +> ListRecipientsResponse ListRecipient(ctx, optional) + +Retrieve recipients + +**This endpoint allows you to retrieve all of your Marketing Campaigns recipients.** Batch deletion of a page makes it possible to receive an empty page of recipients before reaching the end of the list of recipients. To avoid this issue; iterate over pages until a 404 is retrieved. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListRecipientParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Page** | **int32** | Page index of first recipients to return (must be a positive integer) +**PageSize** | **int32** | Number of recipients to return at a time (must be a positive integer between 1 and 1000) +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListRecipientsResponse**](ListRecipientsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListRecipientCount.md b/rest/api/v3/lmc_contactdb/docs/ListRecipientCount.md new file mode 100644 index 00000000..32ab38da --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListRecipientCount.md @@ -0,0 +1,48 @@ +# ListRecipientCount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListRecipientCount**](ListRecipientCount.md#ListRecipientCount) | **Get** /v3/contactdb/recipients/count | Retrieve a Count of Recipients + + + +## ListRecipientCount + +> ContactdbRecipientCount200 ListRecipientCount(ctx, optional) + +Retrieve a Count of Recipients + +**This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListRecipientCountParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ContactdbRecipientCount200**](ContactdbRecipientCount200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListRecipientForSegment.md b/rest/api/v3/lmc_contactdb/docs/ListRecipientForSegment.md new file mode 100644 index 00000000..e1484761 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListRecipientForSegment.md @@ -0,0 +1,54 @@ +# ListRecipientForSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListRecipientForSegment**](ListRecipientForSegment.md#ListRecipientForSegment) | **Get** /v3/contactdb/segments/{SegmentId}/recipients | Retrieve recipients on a segment + + + +## ListRecipientForSegment + +> ListRecipientsOnASegmentResponse ListRecipientForSegment(ctx, SegmentIdoptional) + +Retrieve recipients on a segment + +**This endpoint allows you to retrieve all of the recipients in a segment with the given ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **int32** | The ID of the segment from which you want to retrieve recipients. + +### Other Parameters + +Other parameters are passed through a pointer to a ListRecipientForSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Page** | **int32** | +**PageSize** | **int32** | +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListRecipientsOnASegmentResponse**](ListRecipientsOnASegmentResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList.md b/rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList.md new file mode 100644 index 00000000..a0670961 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList.md @@ -0,0 +1,54 @@ +# ListRecipientsFromContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListRecipientsFromContactDbList**](ListRecipientsFromContactDbList.md#ListRecipientsFromContactDbList) | **Get** /v3/contactdb/lists/{ListId}/recipients | Retrieve all recipients on a List + + + +## ListRecipientsFromContactDbList + +> ListRecipientsFromContactDbList200Response ListRecipientsFromContactDbList(ctx, ListIdoptional) + +Retrieve all recipients on a List + +**This endpoint allows you to retrieve all recipients on the list with the given ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ListId** | **int32** | The id of the list of recipients you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a ListRecipientsFromContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Page** | **int32** | Page index of first recipient to return (must be a positive integer) +**PageSize** | **int32** | Number of recipients to return at a time (must be a positive integer between 1 and 1000) +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListRecipientsFromContactDbList200Response**](ListRecipientsFromContactDbList200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList200Response.md b/rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList200Response.md new file mode 100644 index 00000000..2b06300b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListRecipientsFromContactDbList200Response.md @@ -0,0 +1,11 @@ +# ListRecipientsFromContactDbList200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Recipients** | [**[]ContactdbRecipient200**](ContactdbRecipient200.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListRecipientsOnASegmentResponse.md b/rest/api/v3/lmc_contactdb/docs/ListRecipientsOnASegmentResponse.md new file mode 100644 index 00000000..cc781fe7 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListRecipientsOnASegmentResponse.md @@ -0,0 +1,11 @@ +# ListRecipientsOnASegmentResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Recipients** | [**[]ContactdbRecipient200**](ContactdbRecipient200.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListRecipientsResponse.md b/rest/api/v3/lmc_contactdb/docs/ListRecipientsResponse.md new file mode 100644 index 00000000..9b46f996 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListRecipientsResponse.md @@ -0,0 +1,11 @@ +# ListRecipientsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Recipients** | **[]map[string]interface{}** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListReservedField.md b/rest/api/v3/lmc_contactdb/docs/ListReservedField.md new file mode 100644 index 00000000..18387270 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListReservedField.md @@ -0,0 +1,48 @@ +# ListReservedField + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListReservedField**](ListReservedField.md#ListReservedField) | **Get** /v3/contactdb/reserved_fields | Retrieve reserved fields + + + +## ListReservedField + +> ListReservedField200Response ListReservedField(ctx, optional) + +Retrieve reserved fields + +**This endpoint allows you to list all fields that are reserved and can't be used for custom field names.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListReservedFieldParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListReservedField200Response**](ListReservedField200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListReservedField200Response.md b/rest/api/v3/lmc_contactdb/docs/ListReservedField200Response.md new file mode 100644 index 00000000..5cad5ed8 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListReservedField200Response.md @@ -0,0 +1,11 @@ +# ListReservedField200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ReservedFields** | [**[]ListReservedField200ResponseReservedFieldsInner**](ListReservedField200ResponseReservedFieldsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListReservedField200ResponseReservedFieldsInner.md b/rest/api/v3/lmc_contactdb/docs/ListReservedField200ResponseReservedFieldsInner.md new file mode 100644 index 00000000..01d7b2cd --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListReservedField200ResponseReservedFieldsInner.md @@ -0,0 +1,12 @@ +# ListReservedField200ResponseReservedFieldsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | |[optional] +**Type** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListSearchRecipient.md b/rest/api/v3/lmc_contactdb/docs/ListSearchRecipient.md new file mode 100644 index 00000000..1ff79ab8 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListSearchRecipient.md @@ -0,0 +1,49 @@ +# ListSearchRecipient + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSearchRecipient**](ListSearchRecipient.md#ListSearchRecipient) | **Get** /v3/contactdb/recipients/search | Search recipients + + + +## ListSearchRecipient + +> ListRecipientsFromContactDbList200Response ListSearchRecipient(ctx, optional) + +Search recipients + +**This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.** field_name: * is a variable that is substituted for your actual custom field name from your recipient. * Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200) * If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through Mon, 02 Feb 2015 23:59:59 GMT. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSearchRecipientParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**FieldName** | **string** | +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListRecipientsFromContactDbList200Response**](ListRecipientsFromContactDbList200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListSegment.md b/rest/api/v3/lmc_contactdb/docs/ListSegment.md new file mode 100644 index 00000000..d4f37a4f --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListSegment.md @@ -0,0 +1,48 @@ +# ListSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSegment**](ListSegment.md#ListSegment) | **Get** /v3/contactdb/segments | Retrieve all segments + + + +## ListSegment + +> ListAllSegmentsResponse ListSegment(ctx, optional) + +Retrieve all segments + +**This endpoint allows you to retrieve all of your segments.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListAllSegmentsResponse**](ListAllSegmentsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListStatus.md b/rest/api/v3/lmc_contactdb/docs/ListStatus.md new file mode 100644 index 00000000..99c3cd47 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListStatus.md @@ -0,0 +1,48 @@ +# ListStatus + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListStatus**](ListStatus.md#ListStatus) | **Get** /v3/contactdb/status | Get Recipient Upload Status + + + +## ListStatus + +> ListStatus200Response ListStatus(ctx, optional) + +Get Recipient Upload Status + +**This endpoint allows you to check the upload status of a Marketing Campaigns recipient.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListStatusParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListStatus200Response**](ListStatus200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/ListStatus200Response.md b/rest/api/v3/lmc_contactdb/docs/ListStatus200Response.md new file mode 100644 index 00000000..942a9d91 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListStatus200Response.md @@ -0,0 +1,11 @@ +# ListStatus200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | [**[]ListStatus200ResponseStatusInner**](ListStatus200ResponseStatusInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/ListStatus200ResponseStatusInner.md b/rest/api/v3/lmc_contactdb/docs/ListStatus200ResponseStatusInner.md new file mode 100644 index 00000000..4e008b0b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/ListStatus200ResponseStatusInner.md @@ -0,0 +1,12 @@ +# ListStatus200ResponseStatusInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Valid values are \"worker_delay\" and \"worker_delay_seconds\" (the second value appears only if \"worker_delay\" has a value of \"delayed\"). |[optional] [default to ""] +**Value** | **string** | Valid values for the ID \"worker_delay\" are \"OK\" or \"Delayed\". Valid values for the ID \"worker_delay_seconds\" is the time of delay to upload. |[optional] [default to ""] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/Operator.md b/rest/api/v3/lmc_contactdb/docs/Operator.md new file mode 100644 index 00000000..180b3c04 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/Operator.md @@ -0,0 +1,16 @@ +# Operator + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**EQ** | string | (value: `"eq"`) +**NE** | string | (value: `"ne"`) +**LT** | string | (value: `"lt"`) +**GT** | string | (value: `"gt"`) +**CONTAINS** | string | (value: `"contains"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/SearchRecipient.md b/rest/api/v3/lmc_contactdb/docs/SearchRecipient.md new file mode 100644 index 00000000..81e7460c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/SearchRecipient.md @@ -0,0 +1,48 @@ +# SearchRecipient + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SearchRecipient**](SearchRecipient.md#SearchRecipient) | **Post** /v3/contactdb/recipients/search | Search recipients + + + +## SearchRecipient + +> SearchRecipient200Response SearchRecipient(ctx, optional) + +Search recipients + +Search using segment conditions without actually creating a segment. Body contains a JSON object with `conditions`, a list of conditions as described below, and an optional `list_id`, which is a valid list ID for a list to limit the search on. Valid operators for create and update depend on the type of the field for which you are searching. - Dates: - `\"eq\"`, `\"ne\"`, `\"lt\"` (before), `\"gt\"` (after) - You may use MM/DD/YYYY for day granularity or an epoch for second granularity. - `\"empty\"`, `\"not_empty\"` - `\"is within\"` - You may use an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date format or the # of days. - Text: `\"contains\"`, `\"eq\"` (is - matches the full field), `\"ne\"` (is not - matches any field where the entire field is not the condition value), `\"empty\"`, `\"not_empty\"` - Numbers: `\"eq\"`, `\"lt\"`, `\"gt\"`, `\"empty\"`, `\"not_empty\"` - Email Clicks and Opens: `\"eq\"` (opened), `\"ne\"` (not opened) Field values must all be a string. Search conditions using `\"eq\"` or `\"ne\"` for email clicks and opens should provide a \"field\" of either `clicks.campaign_identifier` or `opens.campaign_identifier`. The condition value should be a string containing the id of a completed campaign. Search conditions list may contain multiple conditions, joined by an `\"and\"` or `\"or\"` in the `\"and_or\"` field. The first condition in the conditions list must have an empty `\"and_or\"`, and subsequent conditions must all specify an `\"and_or\"`. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a SearchRecipientParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SearchRecipientRequest** | [**SearchRecipientRequest**](SearchRecipientRequest.md) | + +### Return type + +[**SearchRecipient200Response**](SearchRecipient200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/SearchRecipient200Response.md b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200Response.md new file mode 100644 index 00000000..c91ecb0a --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200Response.md @@ -0,0 +1,12 @@ +# SearchRecipient200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Recipients** | [**[]SearchRecipient200ResponseRecipientsInner**](SearchRecipient200ResponseRecipientsInner.md) | |[optional] +**RecipientCount** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInner.md b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInner.md new file mode 100644 index 00000000..7ebc565e --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInner.md @@ -0,0 +1,19 @@ +# SearchRecipient200ResponseRecipientsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **int32** | |[optional] +**Email** | **string** | |[optional] +**Id** | **string** | |[optional] +**LastEmailed** | **int32** | |[optional] +**LastClicked** | **int32** | |[optional] +**LastOpened** | **int32** | |[optional] +**CustomFields** | [**[]SearchRecipient200ResponseRecipientsInnerCustomFieldsInner**](SearchRecipient200ResponseRecipientsInnerCustomFieldsInner.md) | |[optional] +**UpdatedAt** | **int32** | |[optional] +**FirstName** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInner.md b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInner.md new file mode 100644 index 00000000..6d09dded --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInner.md @@ -0,0 +1,14 @@ +# SearchRecipient200ResponseRecipientsInnerCustomFieldsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | |[optional] +**Name** | **string** | |[optional] +**Value** | [**SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue**](SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue.md) | |[optional] +**Type** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue.md b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue.md new file mode 100644 index 00000000..73d53eb3 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue.md @@ -0,0 +1,10 @@ +# SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/SearchRecipientRequest.md b/rest/api/v3/lmc_contactdb/docs/SearchRecipientRequest.md new file mode 100644 index 00000000..de0b218c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/SearchRecipientRequest.md @@ -0,0 +1,12 @@ +# SearchRecipientRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ListId** | **int32** | | +**Conditions** | [**[]ContactdbSegmentsConditions**](ContactdbSegmentsConditions.md) | The conditions by which this segment should be created. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/Type.md b/rest/api/v3/lmc_contactdb/docs/Type.md new file mode 100644 index 00000000..94e01859 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/Type.md @@ -0,0 +1,14 @@ +# Type + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DATE** | string | (value: `"date"`) +**TEXT** | string | (value: `"text"`) +**NUMBER** | string | (value: `"number"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/UpdateAListRequest.md b/rest/api/v3/lmc_contactdb/docs/UpdateAListRequest.md new file mode 100644 index 00000000..5d1b4ce2 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/UpdateAListRequest.md @@ -0,0 +1,11 @@ +# UpdateAListRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The new name for your list. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/UpdateContactDbList.md b/rest/api/v3/lmc_contactdb/docs/UpdateContactDbList.md new file mode 100644 index 00000000..3285fc16 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/UpdateContactDbList.md @@ -0,0 +1,53 @@ +# UpdateContactDbList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateContactDbList**](UpdateContactDbList.md#UpdateContactDbList) | **Patch** /v3/contactdb/lists/{ListId} | Update a List + + + +## UpdateContactDbList + +> UpdateContactDbList200Response UpdateContactDbList(ctx, ListIdoptional) + +Update a List + +**This endpoint allows you to update the name of one of your recipient lists.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ListId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateContactDbListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateAListRequest** | [**UpdateAListRequest**](UpdateAListRequest.md) | + +### Return type + +[**UpdateContactDbList200Response**](UpdateContactDbList200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/UpdateContactDbList200Response.md b/rest/api/v3/lmc_contactdb/docs/UpdateContactDbList200Response.md new file mode 100644 index 00000000..de79f5bc --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/UpdateContactDbList200Response.md @@ -0,0 +1,13 @@ +# UpdateContactDbList200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the list |[optional] +**Name** | **string** | The new name for the list |[optional] +**RecipientCount** | **int32** | The number of recipients on the list |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/UpdateRecipient.md b/rest/api/v3/lmc_contactdb/docs/UpdateRecipient.md new file mode 100644 index 00000000..91d05ad5 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/UpdateRecipient.md @@ -0,0 +1,49 @@ +# UpdateRecipient + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateRecipient**](UpdateRecipient.md#UpdateRecipient) | **Patch** /v3/contactdb/recipients | Update Recipient + + + +## UpdateRecipient + +> ContactdbRecipientResponse201 UpdateRecipient(ctx, optional) + +Update Recipient + +**This endpoint allows you to update one or more recipients.** The body of an API call to this endpoint must include an array of one or more recipient objects. It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateRecipientParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateRecipientRequestInner** | [**[]UpdateRecipientRequestInner**](UpdateRecipientRequestInner.md) | + +### Return type + +[**ContactdbRecipientResponse201**](ContactdbRecipientResponse201.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/UpdateRecipientRequestInner.md b/rest/api/v3/lmc_contactdb/docs/UpdateRecipientRequestInner.md new file mode 100644 index 00000000..0babc15d --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/UpdateRecipientRequestInner.md @@ -0,0 +1,13 @@ +# UpdateRecipientRequestInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | | +**LastName** | **string** | The last name of the recipient. This is one of the default custom fields. |[optional] +**FirstName** | **string** | The first name of the recipient. This is one of the default custom fields. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/docs/UpdateSegment.md b/rest/api/v3/lmc_contactdb/docs/UpdateSegment.md new file mode 100644 index 00000000..57d79bd4 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/UpdateSegment.md @@ -0,0 +1,53 @@ +# UpdateSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSegment**](UpdateSegment.md#UpdateSegment) | **Patch** /v3/contactdb/segments/{SegmentId} | Update a segment + + + +## UpdateSegment + +> ContactdbSegments UpdateSegment(ctx, SegmentIdoptional) + +Update a segment + +**This endpoint allows you to update a segment.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **int32** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateSegmentRequest** | [**UpdateSegmentRequest**](UpdateSegmentRequest.md) | + +### Return type + +[**ContactdbSegments**](ContactdbSegments.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_contactdb/docs/UpdateSegmentRequest.md b/rest/api/v3/lmc_contactdb/docs/UpdateSegmentRequest.md new file mode 100644 index 00000000..606cf19d --- /dev/null +++ b/rest/api/v3/lmc_contactdb/docs/UpdateSegmentRequest.md @@ -0,0 +1,13 @@ +# UpdateSegmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**ListId** | **float32** | The list ID you would like this segment to be built from. |[optional] +**Conditions** | [**[]ContactdbSegmentsConditions**](ContactdbSegmentsConditions.md) | The conditions by which this segment should be created. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_contactdb/model_add_recipient_request_inner.go b/rest/api/v3/lmc_contactdb/model_add_recipient_request_inner.go new file mode 100644 index 00000000..e5fa05f6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_add_recipient_request_inner.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AddRecipientRequestInner struct for AddRecipientRequestInner +type AddRecipientRequestInner struct { + // The email address of the recipient. + Email string `json:"email"` + // The first name of the recipient. + FirstName *string `json:"first_name,omitempty"` + // The last name of the recipient. + LastName *string `json:"last_name,omitempty"` + Age *int32 `json:"age,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_and_or.go b/rest/api/v3/lmc_contactdb/model_and_or.go new file mode 100644 index 00000000..60a341a2 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_and_or.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AndOr the model 'AndOr' +type AndOr string + +// List of AndOr +const ( + ANDOR_AND AndOr = "and" + ANDOR_OR AndOr = "or" + ANDOR_EMPTY AndOr = "" +) diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_custom_field.go b/rest/api/v3/lmc_contactdb/model_contactdb_custom_field.go new file mode 100644 index 00000000..480b2ede --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_custom_field.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbCustomField struct for ContactdbCustomField +type ContactdbCustomField struct { + // The name of the field + Name *string `json:"name,omitempty"` + // The type of the field. + Type *Type `json:"type,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id2xx.go b/rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id2xx.go new file mode 100644 index 00000000..607a50eb --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id2xx.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbCustomFieldId2xx struct for ContactdbCustomFieldId2xx +type ContactdbCustomFieldId2xx struct { + // The name of the field + Name *string `json:"name,omitempty"` + // The type of the field. + Type *Type `json:"type,omitempty"` + // The ID of the custom field. + Id *float32 `json:"id,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id_value.go b/rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id_value.go new file mode 100644 index 00000000..0e99ac75 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_custom_field_id_value.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbCustomFieldIdValue struct for ContactdbCustomFieldIdValue +type ContactdbCustomFieldIdValue struct { + // The name of the field + Name *string `json:"name,omitempty"` + // The type of the field. + Type *Type `json:"type,omitempty"` + // The ID of the custom field. + Id *float32 `json:"id,omitempty"` + // The value of this recipient's custom field + Value *string `json:"value,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_list2xx.go b/rest/api/v3/lmc_contactdb/model_contactdb_list2xx.go new file mode 100644 index 00000000..9a8f2703 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_list2xx.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbList2xx struct for ContactdbList2xx +type ContactdbList2xx struct { + // The reference ID of your list. + Id int32 `json:"id"` + // The name of your list. Must be unique against all other list and segment names. + Name string `json:"name"` + // The count of recipients currently in the list. + RecipientCount int32 `json:"recipient_count"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_recipient200.go b/rest/api/v3/lmc_contactdb/model_contactdb_recipient200.go new file mode 100644 index 00000000..59735840 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_recipient200.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbRecipient200 struct for ContactdbRecipient200 +type ContactdbRecipient200 struct { + Recipients *[]ContactdbRecipient200RecipientsInner `json:"recipients,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_recipient200_recipients_inner.go b/rest/api/v3/lmc_contactdb/model_contactdb_recipient200_recipients_inner.go new file mode 100644 index 00000000..5b165ca2 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_recipient200_recipients_inner.go @@ -0,0 +1,38 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbRecipient200RecipientsInner struct for ContactdbRecipient200RecipientsInner +type ContactdbRecipient200RecipientsInner struct { + // The ID of this recipient. + Id *string `json:"id,omitempty"` + // The time this record was created in your contactdb, in unixtime. + CreatedAt *float32 `json:"created_at,omitempty"` + // The custom fields assigned to this recipient and their values. + CustomFields *[]ContactdbCustomFieldIdValue `json:"custom_fields,omitempty"` + // The email address of this recipient. This is a default custom field that SendGrid provides. + Email string `json:"email"` + // The first name of this recipient. This is a default custom field that SendGrid provides. + FirstName *string `json:"first_name,omitempty"` + // The last name of the recipient. + LastName *string `json:"last_name,omitempty"` + // The last time this recipient clicked a link from one of your campaigns, in unixtime. + LastClicked *float32 `json:"last_clicked,omitempty"` + // The last time this user was emailed by one of your campaigns, in unixtime. + LastEmailed *float32 `json:"last_emailed,omitempty"` + // The last time this recipient opened an email from you, in unixtime. + LastOpened *float32 `json:"last_opened,omitempty"` + // The last update date for this recipient's record. + UpdatedAt *float32 `json:"updated_at,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_recipient_count200.go b/rest/api/v3/lmc_contactdb/model_contactdb_recipient_count200.go new file mode 100644 index 00000000..7e4a3521 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_recipient_count200.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbRecipientCount200 struct for ContactdbRecipientCount200 +type ContactdbRecipientCount200 struct { + // The count of recipients. + RecipientCount float32 `json:"recipient_count"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201.go b/rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201.go new file mode 100644 index 00000000..b48d3be5 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201.go @@ -0,0 +1,29 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbRecipientResponse201 struct for ContactdbRecipientResponse201 +type ContactdbRecipientResponse201 struct { + // The number of errors found while adding recipients. + ErrorCount float32 `json:"error_count"` + // The indices of the recipient(s) sent that caused the error. + ErrorIndices *[]float32 `json:"error_indices,omitempty"` + // The count of new recipients added to the contactdb. + NewCount float32 `json:"new_count"` + // The recipient IDs of the recipients that already existed from this request. + PersistedRecipients []string `json:"persisted_recipients"` + // The recipients who were updated from this request. + UpdatedCount float32 `json:"updated_count"` + Errors *[]ContactdbRecipientResponse201ErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201_errors_inner.go b/rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201_errors_inner.go new file mode 100644 index 00000000..4ae71cd8 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_recipient_response201_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbRecipientResponse201ErrorsInner struct for ContactdbRecipientResponse201ErrorsInner +type ContactdbRecipientResponse201ErrorsInner struct { + Message *string `json:"message,omitempty"` + ErrorIndices *[]float32 `json:"error_indices,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_segments.go b/rest/api/v3/lmc_contactdb/model_contactdb_segments.go new file mode 100644 index 00000000..7fe704db --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_segments.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbSegments struct for ContactdbSegments +type ContactdbSegments struct { + // The name of this segment. + Name string `json:"name"` + // The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list. + ListId *int32 `json:"list_id,omitempty"` + // The conditions for a recipient to be included in this segment. + Conditions []ContactdbSegmentsConditions `json:"conditions"` + // The count of recipients in this list. This is not included on creation of segments. + RecipientCount *float32 `json:"recipient_count,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_segments_conditions.go b/rest/api/v3/lmc_contactdb/model_contactdb_segments_conditions.go new file mode 100644 index 00000000..c0e67a33 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_segments_conditions.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbSegmentsConditions struct for ContactdbSegmentsConditions +type ContactdbSegmentsConditions struct { + Field string `json:"field"` + Value string `json:"value"` + Operator Operator `json:"operator"` + AndOr *AndOr `json:"and_or,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_contactdb_segments_id200.go b/rest/api/v3/lmc_contactdb/model_contactdb_segments_id200.go new file mode 100644 index 00000000..b3a4b612 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_contactdb_segments_id200.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactdbSegmentsId200 struct for ContactdbSegmentsId200 +type ContactdbSegmentsId200 struct { + // The ID of the segment. + Id float32 `json:"id"` + // The name of this segment. + Name string `json:"name"` + // The list id from which to make this segment. Not including this ID will mean your segment is created from the main contactdb rather than a list. + ListId *int32 `json:"list_id,omitempty"` + // The conditions for a recipient to be included in this segment. + Conditions []ContactdbSegmentsConditions `json:"conditions"` + // The count of recipients in this list. This is not included on creation of segments. + RecipientCount *float32 `json:"recipient_count,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_create_a_list_request.go b/rest/api/v3/lmc_contactdb/model_create_a_list_request.go new file mode 100644 index 00000000..773c84de --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_create_a_list_request.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateAListRequest struct for CreateAListRequest +type CreateAListRequest struct { + Name string `json:"name"` +} diff --git a/rest/api/v3/lmc_contactdb/model_create_custom_field_request.go b/rest/api/v3/lmc_contactdb/model_create_custom_field_request.go new file mode 100644 index 00000000..e17c24ac --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_create_custom_field_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateCustomFieldRequest struct for CreateCustomFieldRequest +type CreateCustomFieldRequest struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_delete_contacts.go b/rest/api/v3/lmc_contactdb/model_delete_contacts.go new file mode 100644 index 00000000..f916ee14 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_delete_contacts.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteContacts the model 'DeleteContacts' +type DeleteContacts bool + +// List of DeleteContacts +const ( + DELETECONTACTS_TRUE DeleteContacts = true + DELETECONTACTS_FALSE DeleteContacts = false +) diff --git a/rest/api/v3/lmc_contactdb/model_error_response.go b/rest/api/v3/lmc_contactdb/model_error_response.go new file mode 100644 index 00000000..9edcd5e2 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_error_response_errors_inner.go b/rest/api/v3/lmc_contactdb/model_error_response_errors_inner.go new file mode 100644 index 00000000..64ff20ee --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_get_recipient_list_200_response.go b/rest/api/v3/lmc_contactdb/model_get_recipient_list_200_response.go new file mode 100644 index 00000000..3812b9ef --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_get_recipient_list_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetRecipientList200Response struct for GetRecipientList200Response +type GetRecipientList200Response struct { + Lists *[]ContactdbList2xx `json:"lists,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_all_custom_fields_response.go b/rest/api/v3/lmc_contactdb/model_list_all_custom_fields_response.go new file mode 100644 index 00000000..80c1834b --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_all_custom_fields_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAllCustomFieldsResponse struct for ListAllCustomFieldsResponse +type ListAllCustomFieldsResponse struct { + CustomFields []ContactdbCustomFieldId2xx `json:"custom_fields"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_all_lists_response.go b/rest/api/v3/lmc_contactdb/model_list_all_lists_response.go new file mode 100644 index 00000000..beb23c3c --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_all_lists_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAllListsResponse struct for ListAllListsResponse +type ListAllListsResponse struct { + Lists []ContactdbList2xx `json:"lists"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_all_segments_response.go b/rest/api/v3/lmc_contactdb/model_list_all_segments_response.go new file mode 100644 index 00000000..9df8c58e --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_all_segments_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListAllSegmentsResponse struct for ListAllSegmentsResponse +type ListAllSegmentsResponse struct { + Segments []ContactdbSegments `json:"segments"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_recipients_from_contact_db_list_200_response.go b/rest/api/v3/lmc_contactdb/model_list_recipients_from_contact_db_list_200_response.go new file mode 100644 index 00000000..d271c30d --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_recipients_from_contact_db_list_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListRecipientsFromContactDbList200Response struct for ListRecipientsFromContactDbList200Response +type ListRecipientsFromContactDbList200Response struct { + Recipients *[]ContactdbRecipient200 `json:"recipients,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_recipients_on_a_segment_response.go b/rest/api/v3/lmc_contactdb/model_list_recipients_on_a_segment_response.go new file mode 100644 index 00000000..2c9656c9 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_recipients_on_a_segment_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListRecipientsOnASegmentResponse struct for ListRecipientsOnASegmentResponse +type ListRecipientsOnASegmentResponse struct { + Recipients []ContactdbRecipient200 `json:"recipients"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_recipients_response.go b/rest/api/v3/lmc_contactdb/model_list_recipients_response.go new file mode 100644 index 00000000..b09ef108 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_recipients_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListRecipientsResponse struct for ListRecipientsResponse +type ListRecipientsResponse struct { + Recipients []map[string]interface{} `json:"recipients"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response.go b/rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response.go new file mode 100644 index 00000000..19b63d9e --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListReservedField200Response struct for ListReservedField200Response +type ListReservedField200Response struct { + ReservedFields *[]ListReservedField200ResponseReservedFieldsInner `json:"reserved_fields,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response_reserved_fields_inner.go b/rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response_reserved_fields_inner.go new file mode 100644 index 00000000..d213170a --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_reserved_field_200_response_reserved_fields_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListReservedField200ResponseReservedFieldsInner struct for ListReservedField200ResponseReservedFieldsInner +type ListReservedField200ResponseReservedFieldsInner struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_status_200_response.go b/rest/api/v3/lmc_contactdb/model_list_status_200_response.go new file mode 100644 index 00000000..b357ab9a --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_status_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListStatus200Response struct for ListStatus200Response +type ListStatus200Response struct { + Status *[]ListStatus200ResponseStatusInner `json:"status,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_list_status_200_response_status_inner.go b/rest/api/v3/lmc_contactdb/model_list_status_200_response_status_inner.go new file mode 100644 index 00000000..89247e3e --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_list_status_200_response_status_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListStatus200ResponseStatusInner struct for ListStatus200ResponseStatusInner +type ListStatus200ResponseStatusInner struct { + // Valid values are \"worker_delay\" and \"worker_delay_seconds\" (the second value appears only if \"worker_delay\" has a value of \"delayed\"). + Id *string `json:"id,omitempty"` + // Valid values for the ID \"worker_delay\" are \"OK\" or \"Delayed\". Valid values for the ID \"worker_delay_seconds\" is the time of delay to upload. + Value *string `json:"value,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_operator.go b/rest/api/v3/lmc_contactdb/model_operator.go new file mode 100644 index 00000000..da90b9e6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_operator.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Operator the model 'Operator' +type Operator string + +// List of Operator +const ( + OPERATOR_EQ Operator = "eq" + OPERATOR_NE Operator = "ne" + OPERATOR_LT Operator = "lt" + OPERATOR_GT Operator = "gt" + OPERATOR_CONTAINS Operator = "contains" +) diff --git a/rest/api/v3/lmc_contactdb/model_search_recipient_200_response.go b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response.go new file mode 100644 index 00000000..0285df3f --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SearchRecipient200Response struct for SearchRecipient200Response +type SearchRecipient200Response struct { + Recipients *[]SearchRecipient200ResponseRecipientsInner `json:"recipients,omitempty"` + RecipientCount *int32 `json:"recipient_count,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner.go b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner.go new file mode 100644 index 00000000..2eba7382 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SearchRecipient200ResponseRecipientsInner struct for SearchRecipient200ResponseRecipientsInner +type SearchRecipient200ResponseRecipientsInner struct { + CreatedAt *int32 `json:"created_at,omitempty"` + Email *string `json:"email,omitempty"` + Id *string `json:"id,omitempty"` + LastEmailed *int32 `json:"last_emailed,omitempty"` + LastClicked *int32 `json:"last_clicked,omitempty"` + LastOpened *int32 `json:"last_opened,omitempty"` + CustomFields *[]SearchRecipient200ResponseRecipientsInnerCustomFieldsInner `json:"custom_fields,omitempty"` + UpdatedAt *int32 `json:"updated_at,omitempty"` + FirstName *string `json:"first_name,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner.go b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner.go new file mode 100644 index 00000000..d541c438 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SearchRecipient200ResponseRecipientsInnerCustomFieldsInner struct for SearchRecipient200ResponseRecipientsInnerCustomFieldsInner +type SearchRecipient200ResponseRecipientsInnerCustomFieldsInner struct { + Id *int32 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Value *SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue `json:"value,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner_value.go b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner_value.go new file mode 100644 index 00000000..6465eb37 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_search_recipient_200_response_recipients_inner_custom_fields_inner_value.go @@ -0,0 +1,18 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue struct for SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue +type SearchRecipient200ResponseRecipientsInnerCustomFieldsInnerValue struct { +} diff --git a/rest/api/v3/lmc_contactdb/model_search_recipient_request.go b/rest/api/v3/lmc_contactdb/model_search_recipient_request.go new file mode 100644 index 00000000..8f940790 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_search_recipient_request.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SearchRecipientRequest struct for SearchRecipientRequest +type SearchRecipientRequest struct { + ListId int32 `json:"list_id"` + // The conditions by which this segment should be created. + Conditions []ContactdbSegmentsConditions `json:"conditions"` +} diff --git a/rest/api/v3/lmc_contactdb/model_type.go b/rest/api/v3/lmc_contactdb/model_type.go new file mode 100644 index 00000000..92c5e4b6 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_type.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_DATE Type = "date" + TYPE_TEXT Type = "text" + TYPE_NUMBER Type = "number" +) diff --git a/rest/api/v3/lmc_contactdb/model_update_a_list_request.go b/rest/api/v3/lmc_contactdb/model_update_a_list_request.go new file mode 100644 index 00000000..db1099c4 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_update_a_list_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateAListRequest struct for UpdateAListRequest +type UpdateAListRequest struct { + // The new name for your list. + Name string `json:"name"` +} diff --git a/rest/api/v3/lmc_contactdb/model_update_contact_db_list_200_response.go b/rest/api/v3/lmc_contactdb/model_update_contact_db_list_200_response.go new file mode 100644 index 00000000..852e50f7 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_update_contact_db_list_200_response.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateContactDbList200Response struct for UpdateContactDbList200Response +type UpdateContactDbList200Response struct { + // The ID of the list + Id *int32 `json:"id,omitempty"` + // The new name for the list + Name *string `json:"name,omitempty"` + // The number of recipients on the list + RecipientCount *int32 `json:"recipient_count,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_update_recipient_request_inner.go b/rest/api/v3/lmc_contactdb/model_update_recipient_request_inner.go new file mode 100644 index 00000000..5382ec99 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_update_recipient_request_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateRecipientRequestInner struct for UpdateRecipientRequestInner +type UpdateRecipientRequestInner struct { + Email string `json:"email"` + // The last name of the recipient. This is one of the default custom fields. + LastName *string `json:"last_name,omitempty"` + // The first name of the recipient. This is one of the default custom fields. + FirstName *string `json:"first_name,omitempty"` +} diff --git a/rest/api/v3/lmc_contactdb/model_update_segment_request.go b/rest/api/v3/lmc_contactdb/model_update_segment_request.go new file mode 100644 index 00000000..f2d1e726 --- /dev/null +++ b/rest/api/v3/lmc_contactdb/model_update_segment_request.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Contacts API +* The Twilio SendGrid Legacy Marketing Campaigns Contacts API allows you to manage your marketing contacts programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns' [Contacts API](https://docs.sendgrid.com/api-reference/contacts/), [Lists API](https://docs.sendgrid.com/api-reference/lists/), and [Segments API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) to manage your contacts. See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSegmentRequest struct for UpdateSegmentRequest +type UpdateSegmentRequest struct { + Name string `json:"name"` + // The list ID you would like this segment to be built from. + ListId *float32 `json:"list_id,omitempty"` + // The conditions by which this segment should be created. + Conditions *[]ContactdbSegmentsConditions `json:"conditions,omitempty"` +} diff --git a/rest/api/v3/lmc_senders/README.md b/rest/api/v3/lmc_senders/README.md new file mode 100644 index 00000000..7f23b87b --- /dev/null +++ b/rest/api/v3/lmc_senders/README.md @@ -0,0 +1,74 @@ +# Go API client for + +The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). + +See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.505489+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateSender* | [**CreateSender**](docs/CreateSender.md#createsender) | **Post** /v3/senders | Create a Sender Identity +*DeleteSender* | [**DeleteSender**](docs/DeleteSender.md#deletesender) | **Delete** /v3/senders/{SenderId} | Delete a Sender Identity +*GetSender* | [**GetSender**](docs/GetSender.md#getsender) | **Get** /v3/senders/{SenderId} | View a Sender Identity +*ListSender* | [**ListSender**](docs/ListSender.md#listsender) | **Get** /v3/senders | Get all Sender Identities +*ResetSenderVerification* | [**ResetSenderVerification**](docs/ResetSenderVerification.md#resetsenderverification) | **Post** /v3/senders/{SenderId}/resend_verification | Resend Sender Identity Verification +*UpdateSender* | [**UpdateSender**](docs/UpdateSender.md#updatesender) | **Patch** /v3/senders/{SenderId} | Update a Sender Identity + + +## Documentation For Models + + - [CreateSender400Response](CreateSender400Response.md) + - [CreateSender400ResponseErrorsInner](CreateSender400ResponseErrorsInner.md) + - [CreateSenderRequest](CreateSenderRequest.md) + - [ListSender200Response](ListSender200Response.md) + - [SenderId](SenderId.md) + - [SenderIdRequest](SenderIdRequest.md) + - [SenderIdRequestFrom](SenderIdRequestFrom.md) + - [SenderIdRequestReplyTo](SenderIdRequestReplyTo.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/lmc_senders/api_create_sender.go b/rest/api/v3/lmc_senders/api_create_sender.go new file mode 100644 index 00000000..a3420d11 --- /dev/null +++ b/rest/api/v3/lmc_senders/api_create_sender.go @@ -0,0 +1,82 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSenderParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateSenderRequest *CreateSenderRequest `json:"CreateSenderRequest,omitempty"` +} + +func (params *CreateSenderParam) SetOnbehalfof(Onbehalfof string) *CreateSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateSenderParam) SetCreateSenderRequest(CreateSenderRequest CreateSenderRequest) *CreateSenderParam { + params.CreateSenderRequest = &CreateSenderRequest + return params +} + +// **This endpoint allows you to create a new sender identity.** You may create up to 100 unique sender identities. +func (c *ApiService) CreateSender(params *CreateSenderParam) (interface{}, error) { + path := "/v3/senders" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateSenderRequest != nil { + b, err := json.Marshal(*params.CreateSenderRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &SenderId{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_senders/api_delete_sender.go b/rest/api/v3/lmc_senders/api_delete_sender.go new file mode 100644 index 00000000..abdf177e --- /dev/null +++ b/rest/api/v3/lmc_senders/api_delete_sender.go @@ -0,0 +1,87 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteSenderParam struct { + // The ID of the sender identity that you want to retrieve. + SenderId *int32 `json:"sender_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteSenderParam) SetSenderId(SenderId int32) *DeleteSenderParam { + params.SenderId = &SenderId + return params +} +func (params *DeleteSenderParam) SetOnbehalfof(Onbehalfof string) *DeleteSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete one of your sender identities.** +func (c *ApiService) DeleteSender(params *DeleteSenderParam) (interface{}, error) { + path := "/v3/senders/{SenderId}" + if params != nil && params.SenderId != nil { + path = strings.Replace(path, "{"+"SenderId"+"}", fmt.Sprint(*params.SenderId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_senders/api_get_sender.go b/rest/api/v3/lmc_senders/api_get_sender.go new file mode 100644 index 00000000..125c0007 --- /dev/null +++ b/rest/api/v3/lmc_senders/api_get_sender.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetSenderParam struct { + // The ID of the sender identity that you want to retrieve. + SenderId *int32 `json:"sender_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetSenderParam) SetSenderId(SenderId int32) *GetSenderParam { + params.SenderId = &SenderId + return params +} +func (params *GetSenderParam) SetOnbehalfof(Onbehalfof string) *GetSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific sender identity.** +func (c *ApiService) GetSender(params *GetSenderParam) (interface{}, error) { + path := "/v3/senders/{SenderId}" + if params != nil && params.SenderId != nil { + path = strings.Replace(path, "{"+"SenderId"+"}", fmt.Sprint(*params.SenderId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SenderId{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_senders/api_list_sender.go b/rest/api/v3/lmc_senders/api_list_sender.go new file mode 100644 index 00000000..f612bc1e --- /dev/null +++ b/rest/api/v3/lmc_senders/api_list_sender.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListSenderParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListSenderParam) SetOnbehalfof(Onbehalfof string) *ListSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a list of all sender identities that have been created for your account.** +func (c *ApiService) ListSender(params *ListSenderParam) (interface{}, error) { + path := "/v3/senders" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListSender200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_senders/api_reset_sender_verification.go b/rest/api/v3/lmc_senders/api_reset_sender_verification.go new file mode 100644 index 00000000..4e93f231 --- /dev/null +++ b/rest/api/v3/lmc_senders/api_reset_sender_verification.go @@ -0,0 +1,87 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ResetSenderVerificationParam struct { + // The ID of the sender identity for which you would like to resend a verification email. + SenderId *int32 `json:"sender_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ResetSenderVerificationParam) SetSenderId(SenderId int32) *ResetSenderVerificationParam { + params.SenderId = &SenderId + return params +} +func (params *ResetSenderVerificationParam) SetOnbehalfof(Onbehalfof string) *ResetSenderVerificationParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to resend a sender identity verification email.** +func (c *ApiService) ResetSenderVerification(params *ResetSenderVerificationParam) (interface{}, error) { + path := "/v3/senders/{SenderId}/resend_verification" + if params != nil && params.SenderId != nil { + path = strings.Replace(path, "{"+"SenderId"+"}", fmt.Sprint(*params.SenderId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_senders/api_service.go b/rest/api/v3/lmc_senders/api_service.go new file mode 100644 index 00000000..aa0529a6 --- /dev/null +++ b/rest/api/v3/lmc_senders/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/lmc_senders/api_update_sender.go b/rest/api/v3/lmc_senders/api_update_sender.go new file mode 100644 index 00000000..ea0161ba --- /dev/null +++ b/rest/api/v3/lmc_senders/api_update_sender.go @@ -0,0 +1,110 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateSenderParam struct { + // The ID of the sender identity that you want to retrieve. + SenderId *int32 `json:"sender_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + SenderIdRequest *SenderIdRequest `json:"SenderIdRequest,omitempty"` +} + +func (params *UpdateSenderParam) SetSenderId(SenderId int32) *UpdateSenderParam { + params.SenderId = &SenderId + return params +} +func (params *UpdateSenderParam) SetOnbehalfof(Onbehalfof string) *UpdateSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateSenderParam) SetSenderIdRequest(SenderIdRequest SenderIdRequest) *UpdateSenderParam { + params.SenderIdRequest = &SenderIdRequest + return params +} + +// **This endpoint allows you to update a sender identity.** Updates to `from.email` require re-verification. Partial updates are allowed, but fields that are marked as \"required\" in the POST (create) endpoint must not be nil if that field is included in the PATCH request. +func (c *ApiService) UpdateSender(params *UpdateSenderParam) (interface{}, error) { + path := "/v3/senders/{SenderId}" + if params != nil && params.SenderId != nil { + path = strings.Replace(path, "{"+"SenderId"+"}", fmt.Sprint(*params.SenderId), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SenderIdRequest != nil { + b, err := json.Marshal(*params.SenderIdRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SenderId{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &CreateSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/lmc_senders/docs/CreateSender.md b/rest/api/v3/lmc_senders/docs/CreateSender.md new file mode 100644 index 00000000..c3e50784 --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/CreateSender.md @@ -0,0 +1,49 @@ +# CreateSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSender**](CreateSender.md#CreateSender) | **Post** /v3/senders | Create a Sender Identity + + + +## CreateSender + +> SenderId CreateSender(ctx, optional) + +Create a Sender Identity + +**This endpoint allows you to create a new sender identity.** You may create up to 100 unique sender identities. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateSenderRequest** | [**CreateSenderRequest**](CreateSenderRequest.md) | + +### Return type + +[**SenderId**](SenderId.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_senders/docs/CreateSender400Response.md b/rest/api/v3/lmc_senders/docs/CreateSender400Response.md new file mode 100644 index 00000000..82215c7b --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/CreateSender400Response.md @@ -0,0 +1,11 @@ +# CreateSender400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]CreateSender400ResponseErrorsInner**](CreateSender400ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/CreateSender400ResponseErrorsInner.md b/rest/api/v3/lmc_senders/docs/CreateSender400ResponseErrorsInner.md new file mode 100644 index 00000000..9ed78de2 --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/CreateSender400ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# CreateSender400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**Field** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/CreateSenderRequest.md b/rest/api/v3/lmc_senders/docs/CreateSenderRequest.md new file mode 100644 index 00000000..97a03bec --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/CreateSenderRequest.md @@ -0,0 +1,19 @@ +# CreateSenderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Nickname** | **string** | A nickname for the sender identity. Not used for sending. | +**From** | **map[string]interface{}** | |[optional] +**ReplyTo** | **map[string]interface{}** | |[optional] +**Address** | **string** | The physical address of the sender identity. | +**Address2** | **string** | Additional sender identity address information. |[optional] +**City** | **string** | The city of the sender identity. | +**State** | **string** | The state of the sender identity. |[optional] +**Zip** | **string** | The zipcode of the sender identity. |[optional] +**Country** | **string** | The country of the sender identity. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/DeleteSender.md b/rest/api/v3/lmc_senders/docs/DeleteSender.md new file mode 100644 index 00000000..5a3cd16b --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/DeleteSender.md @@ -0,0 +1,52 @@ +# DeleteSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSender**](DeleteSender.md#DeleteSender) | **Delete** /v3/senders/{SenderId} | Delete a Sender Identity + + + +## DeleteSender + +> map[string]interface{} DeleteSender(ctx, SenderIdoptional) + +Delete a Sender Identity + +**This endpoint allows you to delete one of your sender identities.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SenderId** | **int32** | The ID of the sender identity that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_senders/docs/GetSender.md b/rest/api/v3/lmc_senders/docs/GetSender.md new file mode 100644 index 00000000..e183cdfd --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/GetSender.md @@ -0,0 +1,52 @@ +# GetSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSender**](GetSender.md#GetSender) | **Get** /v3/senders/{SenderId} | View a Sender Identity + + + +## GetSender + +> SenderId GetSender(ctx, SenderIdoptional) + +View a Sender Identity + +**This endpoint allows you to retrieve a specific sender identity.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SenderId** | **int32** | The ID of the sender identity that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**SenderId**](SenderId.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_senders/docs/ListSender.md b/rest/api/v3/lmc_senders/docs/ListSender.md new file mode 100644 index 00000000..e2cdca72 --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/ListSender.md @@ -0,0 +1,48 @@ +# ListSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSender**](ListSender.md#ListSender) | **Get** /v3/senders | Get all Sender Identities + + + +## ListSender + +> ListSender200Response ListSender(ctx, optional) + +Get all Sender Identities + +**This endpoint allows you to retrieve a list of all sender identities that have been created for your account.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListSender200Response**](ListSender200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_senders/docs/ListSender200Response.md b/rest/api/v3/lmc_senders/docs/ListSender200Response.md new file mode 100644 index 00000000..a43f2cf1 --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/ListSender200Response.md @@ -0,0 +1,11 @@ +# ListSender200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]SenderId**](SenderId.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/ResetSenderVerification.md b/rest/api/v3/lmc_senders/docs/ResetSenderVerification.md new file mode 100644 index 00000000..772fee5c --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/ResetSenderVerification.md @@ -0,0 +1,52 @@ +# ResetSenderVerification + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResetSenderVerification**](ResetSenderVerification.md#ResetSenderVerification) | **Post** /v3/senders/{SenderId}/resend_verification | Resend Sender Identity Verification + + + +## ResetSenderVerification + +> map[string]interface{} ResetSenderVerification(ctx, SenderIdoptional) + +Resend Sender Identity Verification + +**This endpoint allows you to resend a sender identity verification email.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SenderId** | **int32** | The ID of the sender identity for which you would like to resend a verification email. + +### Other Parameters + +Other parameters are passed through a pointer to a ResetSenderVerificationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_senders/docs/SenderId.md b/rest/api/v3/lmc_senders/docs/SenderId.md new file mode 100644 index 00000000..5873d37d --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/SenderId.md @@ -0,0 +1,24 @@ +# SenderId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Nickname** | **string** | A nickname for the sender identity. Not used for sending. | +**From** | [**SenderIdRequestFrom**](SenderIdRequestFrom.md) | |[optional] +**ReplyTo** | [**SenderIdRequestReplyTo**](SenderIdRequestReplyTo.md) | |[optional] +**Address** | **string** | The physical address of the sender identity. | +**Address2** | **string** | Additional sender identity address information. |[optional] +**City** | **string** | The city of the sender identity. | +**State** | **string** | The state of the sender identity. |[optional] +**Zip** | **string** | The zipcode of the sender identity. |[optional] +**Country** | **string** | The country of the sender identity. | +**Id** | **int32** | The unique identifier of the sender identity. |[optional] +**Verified** | **bool** | If the sender identity is verified or not. Only verified sender identities can be used to send email. |[optional] +**UpdatedAt** | **int32** | The time the sender identity was last updated. |[optional] +**CreatedAt** | **int32** | The time the sender identity was created. |[optional] +**Locked** | **bool** | True when the sender id is associated to a campaign in the Draft, Scheduled, or In Progress status. You cannot update or delete a locked sender identity. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/SenderIdRequest.md b/rest/api/v3/lmc_senders/docs/SenderIdRequest.md new file mode 100644 index 00000000..263408e5 --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/SenderIdRequest.md @@ -0,0 +1,19 @@ +# SenderIdRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Nickname** | **string** | A nickname for the sender identity. Not used for sending. |[optional] +**From** | [**SenderIdRequestFrom**](SenderIdRequestFrom.md) | |[optional] +**ReplyTo** | [**SenderIdRequestReplyTo**](SenderIdRequestReplyTo.md) | |[optional] +**Address** | **string** | The physical address of the sender identity. |[optional] +**Address2** | **string** | Additional sender identity address information. |[optional] +**City** | **string** | The city of the sender identity. |[optional] +**State** | **string** | The state of the sender identity. |[optional] +**Zip** | **string** | The zipcode of the sender identity. |[optional] +**Country** | **string** | The country of the sender identity. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/SenderIdRequestFrom.md b/rest/api/v3/lmc_senders/docs/SenderIdRequestFrom.md new file mode 100644 index 00000000..eaf4d8fa --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/SenderIdRequestFrom.md @@ -0,0 +1,12 @@ +# SenderIdRequestFrom + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address from which your recipient will receive emails. |[optional] +**Name** | **string** | The name appended to the from email field. Typically your name or company name. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/SenderIdRequestReplyTo.md b/rest/api/v3/lmc_senders/docs/SenderIdRequestReplyTo.md new file mode 100644 index 00000000..bcdd0642 --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/SenderIdRequestReplyTo.md @@ -0,0 +1,12 @@ +# SenderIdRequestReplyTo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address to which your recipient will reply. |[optional] +**Name** | **string** | The name appended to the reply to email field. Typically your name or company name. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/lmc_senders/docs/UpdateSender.md b/rest/api/v3/lmc_senders/docs/UpdateSender.md new file mode 100644 index 00000000..c48c1685 --- /dev/null +++ b/rest/api/v3/lmc_senders/docs/UpdateSender.md @@ -0,0 +1,53 @@ +# UpdateSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSender**](UpdateSender.md#UpdateSender) | **Patch** /v3/senders/{SenderId} | Update a Sender Identity + + + +## UpdateSender + +> SenderId UpdateSender(ctx, SenderIdoptional) + +Update a Sender Identity + +**This endpoint allows you to update a sender identity.** Updates to `from.email` require re-verification. Partial updates are allowed, but fields that are marked as \"required\" in the POST (create) endpoint must not be nil if that field is included in the PATCH request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SenderId** | **int32** | The ID of the sender identity that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**SenderIdRequest** | [**SenderIdRequest**](SenderIdRequest.md) | + +### Return type + +[**SenderId**](SenderId.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/lmc_senders/model_create_sender_400_response.go b/rest/api/v3/lmc_senders/model_create_sender_400_response.go new file mode 100644 index 00000000..81a60813 --- /dev/null +++ b/rest/api/v3/lmc_senders/model_create_sender_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSender400Response struct for CreateSender400Response +type CreateSender400Response struct { + Errors *[]CreateSender400ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/lmc_senders/model_create_sender_400_response_errors_inner.go b/rest/api/v3/lmc_senders/model_create_sender_400_response_errors_inner.go new file mode 100644 index 00000000..829750a6 --- /dev/null +++ b/rest/api/v3/lmc_senders/model_create_sender_400_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSender400ResponseErrorsInner struct for CreateSender400ResponseErrorsInner +type CreateSender400ResponseErrorsInner struct { + Message *string `json:"message,omitempty"` + Field *string `json:"field,omitempty"` +} diff --git a/rest/api/v3/lmc_senders/model_create_sender_request.go b/rest/api/v3/lmc_senders/model_create_sender_request.go new file mode 100644 index 00000000..a8496af9 --- /dev/null +++ b/rest/api/v3/lmc_senders/model_create_sender_request.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSenderRequest struct for CreateSenderRequest +type CreateSenderRequest struct { + // A nickname for the sender identity. Not used for sending. + Nickname string `json:"nickname"` + From *map[string]interface{} `json:"from,omitempty"` + ReplyTo *map[string]interface{} `json:"reply_to,omitempty"` + // The physical address of the sender identity. + Address string `json:"address"` + // Additional sender identity address information. + Address2 *string `json:"address_2,omitempty"` + // The city of the sender identity. + City string `json:"city"` + // The state of the sender identity. + State *string `json:"state,omitempty"` + // The zipcode of the sender identity. + Zip *string `json:"zip,omitempty"` + // The country of the sender identity. + Country string `json:"country"` +} diff --git a/rest/api/v3/lmc_senders/model_list_sender_200_response.go b/rest/api/v3/lmc_senders/model_list_sender_200_response.go new file mode 100644 index 00000000..7394409a --- /dev/null +++ b/rest/api/v3/lmc_senders/model_list_sender_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSender200Response struct for ListSender200Response +type ListSender200Response struct { + Result *[]SenderId `json:"result,omitempty"` +} diff --git a/rest/api/v3/lmc_senders/model_sender_id.go b/rest/api/v3/lmc_senders/model_sender_id.go new file mode 100644 index 00000000..aa460bd2 --- /dev/null +++ b/rest/api/v3/lmc_senders/model_sender_id.go @@ -0,0 +1,44 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SenderId struct for SenderId +type SenderId struct { + // A nickname for the sender identity. Not used for sending. + Nickname string `json:"nickname"` + From *SenderIdRequestFrom `json:"from,omitempty"` + ReplyTo *SenderIdRequestReplyTo `json:"reply_to,omitempty"` + // The physical address of the sender identity. + Address string `json:"address"` + // Additional sender identity address information. + Address2 *string `json:"address_2,omitempty"` + // The city of the sender identity. + City string `json:"city"` + // The state of the sender identity. + State *string `json:"state,omitempty"` + // The zipcode of the sender identity. + Zip *string `json:"zip,omitempty"` + // The country of the sender identity. + Country string `json:"country"` + // The unique identifier of the sender identity. + Id *int32 `json:"id,omitempty"` + // If the sender identity is verified or not. Only verified sender identities can be used to send email. + Verified *bool `json:"verified,omitempty"` + // The time the sender identity was last updated. + UpdatedAt *int32 `json:"updated_at,omitempty"` + // The time the sender identity was created. + CreatedAt *int32 `json:"created_at,omitempty"` + // True when the sender id is associated to a campaign in the Draft, Scheduled, or In Progress status. You cannot update or delete a locked sender identity. + Locked *bool `json:"locked,omitempty"` +} diff --git a/rest/api/v3/lmc_senders/model_sender_id_request.go b/rest/api/v3/lmc_senders/model_sender_id_request.go new file mode 100644 index 00000000..be2cf28a --- /dev/null +++ b/rest/api/v3/lmc_senders/model_sender_id_request.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SenderIdRequest struct for SenderIdRequest +type SenderIdRequest struct { + // A nickname for the sender identity. Not used for sending. + Nickname *string `json:"nickname,omitempty"` + From *SenderIdRequestFrom `json:"from,omitempty"` + ReplyTo *SenderIdRequestReplyTo `json:"reply_to,omitempty"` + // The physical address of the sender identity. + Address *string `json:"address,omitempty"` + // Additional sender identity address information. + Address2 *string `json:"address_2,omitempty"` + // The city of the sender identity. + City *string `json:"city,omitempty"` + // The state of the sender identity. + State *string `json:"state,omitempty"` + // The zipcode of the sender identity. + Zip *string `json:"zip,omitempty"` + // The country of the sender identity. + Country *string `json:"country,omitempty"` +} diff --git a/rest/api/v3/lmc_senders/model_sender_id_request_from.go b/rest/api/v3/lmc_senders/model_sender_id_request_from.go new file mode 100644 index 00000000..03edf7fe --- /dev/null +++ b/rest/api/v3/lmc_senders/model_sender_id_request_from.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SenderIdRequestFrom struct for SenderIdRequestFrom +type SenderIdRequestFrom struct { + // The email address from which your recipient will receive emails. + Email *string `json:"email,omitempty"` + // The name appended to the from email field. Typically your name or company name. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/lmc_senders/model_sender_id_request_reply_to.go b/rest/api/v3/lmc_senders/model_sender_id_request_reply_to.go new file mode 100644 index 00000000..725356c0 --- /dev/null +++ b/rest/api/v3/lmc_senders/model_sender_id_request_reply_to.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Legacy Marketing Campaigns Sender Identities API +* The Twilio SendGrid Legacy Marketing Campaigns Sender Identites API allows you to manage the email addresses used to send your marketing email. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your [senders](https://docs.sendgrid.com/api-reference/senders/). See [**Migrating from Legacy Marketing Campaigns**](https://docs.sendgrid.com/ui/sending-email/migrating-from-legacy-marketing-campaigns) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SenderIdRequestReplyTo struct for SenderIdRequestReplyTo +type SenderIdRequestReplyTo struct { + // The email address to which your recipient will reply. + Email *string `json:"email,omitempty"` + // The name appended to the reply to email field. Typically your name or company name. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mail/README.md b/rest/api/v3/mail/README.md new file mode 100644 index 00000000..4140add1 --- /dev/null +++ b/rest/api/v3/mail/README.md @@ -0,0 +1,85 @@ +# Go API client for + +The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.956960+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateMailBatch* | [**CreateMailBatch**](docs/CreateMailBatch.md#createmailbatch) | **Post** /v3/mail/batch | Create a batch ID. +*GetMailBatch* | [**GetMailBatch**](docs/GetMailBatch.md#getmailbatch) | **Get** /v3/mail/batch/{BatchId} | Validate a batch ID. +*SendMail* | [**SendMail**](docs/SendMail.md#sendmail) | **Post** /v3/mail/send | Send Email with Twilio SendGrid. + + +## Documentation For Models + + - [ContentEncoding](ContentEncoding.md) + - [Disposition](Disposition.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [MailBatchResponse](MailBatchResponse.md) + - [MailFrom](MailFrom.md) + - [MailTo](MailTo.md) + - [SendMailRequest](SendMailRequest.md) + - [SendMailRequestAsm](SendMailRequestAsm.md) + - [SendMailRequestAttachmentsInner](SendMailRequestAttachmentsInner.md) + - [SendMailRequestContentInner](SendMailRequestContentInner.md) + - [SendMailRequestMailSettings](SendMailRequestMailSettings.md) + - [SendMailRequestMailSettingsBypassBounceManagement](SendMailRequestMailSettingsBypassBounceManagement.md) + - [SendMailRequestMailSettingsBypassListManagement](SendMailRequestMailSettingsBypassListManagement.md) + - [SendMailRequestMailSettingsBypassSpamManagement](SendMailRequestMailSettingsBypassSpamManagement.md) + - [SendMailRequestMailSettingsBypassUnsubscribeManagement](SendMailRequestMailSettingsBypassUnsubscribeManagement.md) + - [SendMailRequestMailSettingsFooter](SendMailRequestMailSettingsFooter.md) + - [SendMailRequestMailSettingsSandboxMode](SendMailRequestMailSettingsSandboxMode.md) + - [SendMailRequestPersonalizationsInner](SendMailRequestPersonalizationsInner.md) + - [SendMailRequestTrackingSettings](SendMailRequestTrackingSettings.md) + - [SendMailRequestTrackingSettingsClickTracking](SendMailRequestTrackingSettingsClickTracking.md) + - [SendMailRequestTrackingSettingsGanalytics](SendMailRequestTrackingSettingsGanalytics.md) + - [SendMailRequestTrackingSettingsOpenTracking](SendMailRequestTrackingSettingsOpenTracking.md) + - [SendMailRequestTrackingSettingsSubscriptionTracking](SendMailRequestTrackingSettingsSubscriptionTracking.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mail/api_create_mail_batch.go b/rest/api/v3/mail/api_create_mail_batch.go new file mode 100644 index 00000000..e832f8cb --- /dev/null +++ b/rest/api/v3/mail/api_create_mail_batch.go @@ -0,0 +1,107 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateMailBatchParam struct { + // Use the `on-behalf-of` header to make API calls for a particular Subuser through the parent account. You can use this header to automate bulk updates or to administer a Subuser without changing the authentication in your code. You will use the parent account's API key when using this header. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *CreateMailBatchParam) SetOnbehalfof(Onbehalfof string) *CreateMailBatchParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This operation allows you to generate a new mail batch ID.** Once a batch ID is created, you can associate it with a mail send by passing it in the request body of the [Mail Send operation](https://docs.sendgrid.com/api-reference/mail-send/mail-send). This makes it possible to group multiple requests to the Mail Send operation by assigning them the same batch ID. A batch ID that's associated with a mail send can be used to access and modify the associated send. For example, you can pause or cancel a send using its batch ID. See the [Scheduled Sends API](https://www.twilio.com/docs/sendgrid/api-reference/cancel-scheduled-sends) for more information about pausing and cancelling a mail send. +func (c *ApiService) CreateMailBatch(params *CreateMailBatchParam) (interface{}, error) { + path := "/v3/mail/batch" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &MailBatchResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 405 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail/api_get_mail_batch.go b/rest/api/v3/mail/api_get_mail_batch.go new file mode 100644 index 00000000..26ce8e90 --- /dev/null +++ b/rest/api/v3/mail/api_get_mail_batch.go @@ -0,0 +1,99 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type GetMailBatchParam struct { + // Use the `on-behalf-of` header to make API calls for a particular Subuser through the parent account. You can use this header to automate bulk updates or to administer a Subuser without changing the authentication in your code. You will use the parent account's API key when using this header. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetMailBatchParam) SetOnbehalfof(Onbehalfof string) *GetMailBatchParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This operation allows you to validate a mail batch ID.** If you provide a valid batch ID, this operation will return a `200` status code and the batch ID itself. If you provide an invalid batch ID, you will receive a `400` level status code and an error message. A batch ID does not need to be assigned to a send to be considered valid. A successful response means only that the batch ID has been created, but it does not indicate that the ID has been assigned to a send. +func (c *ApiService) GetMailBatch(params *GetMailBatchParam) (interface{}, error) { + path := "/v3/mail/batch/{BatchId}" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailBatchResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 405 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail/api_send_mail.go b/rest/api/v3/mail/api_send_mail.go new file mode 100644 index 00000000..e697d176 --- /dev/null +++ b/rest/api/v3/mail/api_send_mail.go @@ -0,0 +1,122 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type SendMailParam struct { + // Use this header when sending a gzip compressed mail body. Mail body compression is available to some high volume accounts. Submit a [request to support](https://support.sendgrid.com/hc/en-us) to have gzip enabled on your account. + ContentEncoding *ContentEncoding `json:"Content-Encoding,omitempty"` + // + SendMailRequest *SendMailRequest `json:"SendMailRequest,omitempty"` +} + +func (params *SendMailParam) SetContentEncoding(ContentEncoding ContentEncoding) *SendMailParam { + params.ContentEncoding = &ContentEncoding + return params +} +func (params *SendMailParam) SetSendMailRequest(SendMailRequest SendMailRequest) *SendMailParam { + params.SendMailRequest = &SendMailRequest + return params +} + +// *The Mail Send operation allows you to send email over SendGrid's v3 Web API* For an overview of this API, including its features and limitations, please see the [Mail Send API overview page](https://www.twilio.com/docs/sendgrid/api-reference/mail-send) The overview page also includes links to SendGrid's Email API quickstarts and helper libraries to get you working with this endpoint even faster. +func (c *ApiService) SendMail(params *SendMailParam) (interface{}, error) { + path := "/v3/mail/send" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SendMailRequest != nil { + b, err := json.Marshal(*params.SendMailRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.ContentEncoding != nil { + headers["Content-Encoding"] = *params.ContentEncoding + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 405 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 413 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail/api_service.go b/rest/api/v3/mail/api_service.go new file mode 100644 index 00000000..0ca11aea --- /dev/null +++ b/rest/api/v3/mail/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mail/docs/ContentEncoding.md b/rest/api/v3/mail/docs/ContentEncoding.md new file mode 100644 index 00000000..d7abc43b --- /dev/null +++ b/rest/api/v3/mail/docs/ContentEncoding.md @@ -0,0 +1,12 @@ +# ContentEncoding + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**GZIP** | string | (value: `"gzip"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/CreateMailBatch.md b/rest/api/v3/mail/docs/CreateMailBatch.md new file mode 100644 index 00000000..f1daaa8b --- /dev/null +++ b/rest/api/v3/mail/docs/CreateMailBatch.md @@ -0,0 +1,48 @@ +# CreateMailBatch + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateMailBatch**](CreateMailBatch.md#CreateMailBatch) | **Post** /v3/mail/batch | Create a batch ID. + + + +## CreateMailBatch + +> MailBatchResponse CreateMailBatch(ctx, optional) + +Create a batch ID. + +**This operation allows you to generate a new mail batch ID.** Once a batch ID is created, you can associate it with a mail send by passing it in the request body of the [Mail Send operation](https://docs.sendgrid.com/api-reference/mail-send/mail-send). This makes it possible to group multiple requests to the Mail Send operation by assigning them the same batch ID. A batch ID that's associated with a mail send can be used to access and modify the associated send. For example, you can pause or cancel a send using its batch ID. See the [Scheduled Sends API](https://www.twilio.com/docs/sendgrid/api-reference/cancel-scheduled-sends) for more information about pausing and cancelling a mail send. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateMailBatchParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | Use the `on-behalf-of` header to make API calls for a particular Subuser through the parent account. You can use this header to automate bulk updates or to administer a Subuser without changing the authentication in your code. You will use the parent account's API key when using this header. + +### Return type + +[**MailBatchResponse**](MailBatchResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail/docs/Disposition.md b/rest/api/v3/mail/docs/Disposition.md new file mode 100644 index 00000000..6240774b --- /dev/null +++ b/rest/api/v3/mail/docs/Disposition.md @@ -0,0 +1,13 @@ +# Disposition + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**INLINE** | string | (value: `"inline"`) +**ATTACHMENT** | string | (value: `"attachment"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/ErrorResponse.md b/rest/api/v3/mail/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/mail/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/ErrorResponseErrorsInner.md b/rest/api/v3/mail/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/mail/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/GetMailBatch.md b/rest/api/v3/mail/docs/GetMailBatch.md new file mode 100644 index 00000000..2257a3fc --- /dev/null +++ b/rest/api/v3/mail/docs/GetMailBatch.md @@ -0,0 +1,48 @@ +# GetMailBatch + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetMailBatch**](GetMailBatch.md#GetMailBatch) | **Get** /v3/mail/batch/{BatchId} | Validate a batch ID. + + + +## GetMailBatch + +> MailBatchResponse GetMailBatch(ctx, optional) + +Validate a batch ID. + +**This operation allows you to validate a mail batch ID.** If you provide a valid batch ID, this operation will return a `200` status code and the batch ID itself. If you provide an invalid batch ID, you will receive a `400` level status code and an error message. A batch ID does not need to be assigned to a send to be considered valid. A successful response means only that the batch ID has been created, but it does not indicate that the ID has been assigned to a send. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a GetMailBatchParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | Use the `on-behalf-of` header to make API calls for a particular Subuser through the parent account. You can use this header to automate bulk updates or to administer a Subuser without changing the authentication in your code. You will use the parent account's API key when using this header. + +### Return type + +[**MailBatchResponse**](MailBatchResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail/docs/MailBatchResponse.md b/rest/api/v3/mail/docs/MailBatchResponse.md new file mode 100644 index 00000000..8103caed --- /dev/null +++ b/rest/api/v3/mail/docs/MailBatchResponse.md @@ -0,0 +1,11 @@ +# MailBatchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BatchId** | **string** | A mail batch ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/MailFrom.md b/rest/api/v3/mail/docs/MailFrom.md new file mode 100644 index 00000000..3f3d4873 --- /dev/null +++ b/rest/api/v3/mail/docs/MailFrom.md @@ -0,0 +1,12 @@ +# MailFrom + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address from which messages are sent. This address should be a verified sender in your Twilio SendGrid account. Email addresses specified in `personalizations` will override addresses set at the message level outside of the `personalizations` object. | +**Name** | **string** | A name or title associated with the email address such as \"Support\" or \"Alex\". |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/MailTo.md b/rest/api/v3/mail/docs/MailTo.md new file mode 100644 index 00000000..70935e77 --- /dev/null +++ b/rest/api/v3/mail/docs/MailTo.md @@ -0,0 +1,12 @@ +# MailTo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | An email address to which a message is sent. Email addresses specified in `personalizations` will override addresses set at the message level outside of the `personalizations` object. | +**Name** | **string** | A name or title associated with the email address such as \"Alex\". |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMail.md b/rest/api/v3/mail/docs/SendMail.md new file mode 100644 index 00000000..450ee26d --- /dev/null +++ b/rest/api/v3/mail/docs/SendMail.md @@ -0,0 +1,49 @@ +# SendMail + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SendMail**](SendMail.md#SendMail) | **Post** /v3/mail/send | Send Email with Twilio SendGrid. + + + +## SendMail + +> SendMail(ctx, optional) + +Send Email with Twilio SendGrid. + +*The Mail Send operation allows you to send email over SendGrid's v3 Web API* For an overview of this API, including its features and limitations, please see the [Mail Send API overview page](https://www.twilio.com/docs/sendgrid/api-reference/mail-send) The overview page also includes links to SendGrid's Email API quickstarts and helper libraries to get you working with this endpoint even faster. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a SendMailParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**ContentEncoding** | [**ContentEncoding**](ContentEncodingContentEncoding.md) | Use this header when sending a gzip compressed mail body. Mail body compression is available to some high volume accounts. Submit a [request to support](https://support.sendgrid.com/hc/en-us) to have gzip enabled on your account. +**SendMailRequest** | [**SendMailRequest**](SendMailRequest.md) | + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail/docs/SendMailRequest.md b/rest/api/v3/mail/docs/SendMailRequest.md new file mode 100644 index 00000000..0bebde09 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequest.md @@ -0,0 +1,27 @@ +# SendMailRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Personalizations** | [**[]SendMailRequestPersonalizationsInner**](SendMailRequestPersonalizationsInner.md) | An array of messages and their metadata. Each object within the `personalizations` array can be thought of as a mail envelope—it defines who should receive an individual message and how that message should be handled. See [**Personalizations**](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for more information. | +**From** | [**MailFrom**](MailFrom.md) | | +**ReplyTo** | [**MailTo**](MailTo.md) | |[optional] +**ReplyToList** | [**[]MailTo**](MailTo.md) | An array of recipients to whom replies will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. You can use either the `reply_to` property or `reply_to_list` property but not both. |[optional] +**Subject** | **string** | The global or _message level_ subject of your email. Subject lines set in personalizations objects will override this global subject line. See line length limits specified in [RFC 2822](https://www.rfc-editor.org/rfc/rfc2822#section-2.1.1) for guidance on subject line character limits. |[optional] +**Content** | [**[]SendMailRequestContentInner**](SendMailRequestContentInner.md) | An array of objects, each containing a message body's content and [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). You must specify at least one MIME type and may include multiple. To include more than one MIME type, add an object for each type to the array. |[optional] +**Attachments** | [**[]SendMailRequestAttachmentsInner**](SendMailRequestAttachmentsInner.md) | An array of objects where you can define any attachments to be included with the message. Each object contains a `content` property, which must be a Base64 encoded string of the attachment itself, and `type`, `filename`, `disposition`, and `content_id` properties that tell SendGrid how to handle the attachment. |[optional] +**TemplateId** | **string** | An email template ID. A template that contains a subject and content—either text or html—will override any subject and content values specified at the `personalizations` or message level. If a template ID begins with `d-`, it is a dynamic template and will work with the `dynamic_template_data` property. If the template ID does not begin with `d-`, it is a standard SendGrid template and will work with the `substitutions` property. See [**How to Send an Email with Dynamic Templates**](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates) for more information about working with templates. |[optional] +**Headers** | **map[string]interface{}** | A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`. |[optional] +**Categories** | **[]string** | An array of category names assigned to this message. Categories allow you to group messages by categories you define. Categories should be used sparingly to create general groups that are relevant to you. Categories are not meant to be used to track individual mail sends. For more granular categorization and tracking, use the `custom_args` property. A category name cannot exceed 255 characters. See [**Working with Categories**](https://docs.sendgrid.com/for-developers/sending-email/categories) for more information. |[optional] +**CustomArgs** | **string** | Values that are specific to the entire send that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is assigned to this property will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `custom_args` set at the personalizations level. Total `custom_args` size may not exceed 10,000 bytes. |[optional] +**SendAt** | **int32** | A [unix timestamp](https://en.wikipedia.org/wiki/Unix_time) allowing you to specify when your email should be sent. A send cannot be scheduled more than 72 hours in advance. This property may be overridden by the `send_at` property set at the personalizations level. |[optional] +**BatchId** | **string** | An ID representing a batch of emails to be sent at the same time. Including a `batch_id` in your request allows you to include this email in that batch. It also enables you to cancel or pause the delivery of that batch. See the [Scheduled Sends API](https://sendgrid.com/docs/api-reference/) for more information about scheduling your email. |[optional] +**Asm** | [**SendMailRequestAsm**](SendMailRequestAsm.md) | |[optional] +**IpPoolName** | **string** | The IP Pool that you would like to send this email from. IP Pools allow you to group your dedicated Twilio SendGrid IP addresses in order to have more control over your deliverability. See [**IP Pools**](https://docs.sendgrid.com/ui/account-and-settings/ip-pools) for more information. |[optional] +**MailSettings** | [**SendMailRequestMailSettings**](SendMailRequestMailSettings.md) | |[optional] +**TrackingSettings** | [**SendMailRequestTrackingSettings**](SendMailRequestTrackingSettings.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestAsm.md b/rest/api/v3/mail/docs/SendMailRequestAsm.md new file mode 100644 index 00000000..b8759b63 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestAsm.md @@ -0,0 +1,12 @@ +# SendMailRequestAsm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GroupId** | **int32** | The unsubscribe group to associate with this email. See the [Suppressions API](https://docs.sendgrid.com/api-reference/suppressions/) to manage unsubscribe group IDs. | +**GroupsToDisplay** | **[]int32** | An array containing the unsubscribe groups that you would like to be displayed to a recipient on the unsubscribe preferences page. This page is displayed in the recipient's browser when they click the unsubscribe link in your message. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestAttachmentsInner.md b/rest/api/v3/mail/docs/SendMailRequestAttachmentsInner.md new file mode 100644 index 00000000..a58a0d58 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestAttachmentsInner.md @@ -0,0 +1,15 @@ +# SendMailRequestAttachmentsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | **string** | The Base64 encoded content of the attachment. | +**Type** | **string** | The MIME type of the content you are attaching (e.g., `image/jpeg` or `application/pdf`). |[optional] +**Filename** | **string** | The attachment's filename, including the file extension. | +**Disposition** | [**Disposition**](Disposition.md) | The attachment's content-disposition specifies how you would like the attachment to be displayed. For example, `inline` results in the attached file being displayed automatically within the message while `attachment` results in the attached file requiring some action to be taken before it is displayed such as opening or downloading the file. |[optional] +**ContentId** | **string** | The attachment's content ID. The `content_id` is used when the `disposition` is set to `inline` and the attachment is an image, allowing the file to be displayed within the body of the email. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestContentInner.md b/rest/api/v3/mail/docs/SendMailRequestContentInner.md new file mode 100644 index 00000000..43c2ae52 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestContentInner.md @@ -0,0 +1,12 @@ +# SendMailRequestContentInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The MIME type of the content assigned in the `value` property of this object (e.g., `text/plain` or `text/html`). | +**Value** | **string** | The content of your message in the specified MIME type assigned in the `type` property of this object. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestMailSettings.md b/rest/api/v3/mail/docs/SendMailRequestMailSettings.md new file mode 100644 index 00000000..c78c164d --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestMailSettings.md @@ -0,0 +1,16 @@ +# SendMailRequestMailSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BypassListManagement** | [**SendMailRequestMailSettingsBypassListManagement**](SendMailRequestMailSettingsBypassListManagement.md) | |[optional] +**BypassSpamManagement** | [**SendMailRequestMailSettingsBypassSpamManagement**](SendMailRequestMailSettingsBypassSpamManagement.md) | |[optional] +**BypassBounceManagement** | [**SendMailRequestMailSettingsBypassBounceManagement**](SendMailRequestMailSettingsBypassBounceManagement.md) | |[optional] +**BypassUnsubscribeManagement** | [**SendMailRequestMailSettingsBypassUnsubscribeManagement**](SendMailRequestMailSettingsBypassUnsubscribeManagement.md) | |[optional] +**Footer** | [**SendMailRequestMailSettingsFooter**](SendMailRequestMailSettingsFooter.md) | |[optional] +**SandboxMode** | [**SendMailRequestMailSettingsSandboxMode**](SendMailRequestMailSettingsSandboxMode.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassBounceManagement.md b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassBounceManagement.md new file mode 100644 index 00000000..56893dd4 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassBounceManagement.md @@ -0,0 +1,11 @@ +# SendMailRequestMailSettingsBypassBounceManagement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassListManagement.md b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassListManagement.md new file mode 100644 index 00000000..fa9c2c7f --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassListManagement.md @@ -0,0 +1,11 @@ +# SendMailRequestMailSettingsBypassListManagement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassSpamManagement.md b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassSpamManagement.md new file mode 100644 index 00000000..a64754af --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassSpamManagement.md @@ -0,0 +1,11 @@ +# SendMailRequestMailSettingsBypassSpamManagement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassUnsubscribeManagement.md b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassUnsubscribeManagement.md new file mode 100644 index 00000000..0ba329fe --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestMailSettingsBypassUnsubscribeManagement.md @@ -0,0 +1,11 @@ +# SendMailRequestMailSettingsBypassUnsubscribeManagement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestMailSettingsFooter.md b/rest/api/v3/mail/docs/SendMailRequestMailSettingsFooter.md new file mode 100644 index 00000000..423727ed --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestMailSettingsFooter.md @@ -0,0 +1,13 @@ +# SendMailRequestMailSettingsFooter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] +**Text** | **string** | The plain text content of your footer. |[optional] +**Html** | **string** | The HTML content of your footer. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestMailSettingsSandboxMode.md b/rest/api/v3/mail/docs/SendMailRequestMailSettingsSandboxMode.md new file mode 100644 index 00000000..f23907e5 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestMailSettingsSandboxMode.md @@ -0,0 +1,11 @@ +# SendMailRequestMailSettingsSandboxMode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestPersonalizationsInner.md b/rest/api/v3/mail/docs/SendMailRequestPersonalizationsInner.md new file mode 100644 index 00000000..f89200e5 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestPersonalizationsInner.md @@ -0,0 +1,20 @@ +# SendMailRequestPersonalizationsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**From** | [**MailFrom**](MailFrom.md) | |[optional] +**To** | [**[]MailTo**](MailTo.md) | An array of recipients to whom the email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. | +**Cc** | [**[]MailTo**](MailTo.md) | An array of recipients to whom a copy of the email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. |[optional] +**Bcc** | [**[]MailTo**](MailTo.md) | An array of recipients to whom a blind carbon copy of your email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. |[optional] +**Subject** | **string** | The subject of your email. See line length limits specified in [RFC 2822](https://www.rfc-editor.org/rfc/rfc2822#section-2.1.1) for guidance on subject line character limits. |[optional] +**Headers** | **map[string]interface{}** | A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`. |[optional] +**Substitutions** | **map[string]string** | A collection property names that will be substituted by their corresponding property values in the `subject`, `reply-to` and `content` portions of your message. Name and value pairs follow the pattern `\"substitution_tag\":\"value to substitute\"`. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object. Substitutions allow you to insert data without using SendGrid's Dynamic Templates. This property should not be used in combination with a Dynamic Template, which can be identified by a `template_id` starting with `d-`. See [**Substitution Tags**](https://docs.sendgrid.com/for-developers/sending-email/substitution-tags) for more information. |[optional] +**DynamicTemplateData** | **map[string]interface{}** | A collection property names that will be substituted by their corresponding property values in the `subject`, `reply-to` and `content` portions of a SendGrid Dynamic Template. Dynamic template data is available in a template using [Handlebars](https://docs.sendgrid.com/for-developers/sending-email/using-handlebars) syntax. This property should be used in combination with a Dynamic Template, which can be identified by a `template_id` starting with `d-`. See [**How to Send an Email with Dynamic Templates**](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates) for more information. |[optional] +**CustomArgs** | **map[string]interface{}** | Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is assigned to this property will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes. |[optional] +**SendAt** | **int32** | A [unix timestamp](https://en.wikipedia.org/wiki/Unix_time) allowing you to specify when your email should be sent. A send cannot be scheduled more than 72 hours in advance. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestTrackingSettings.md b/rest/api/v3/mail/docs/SendMailRequestTrackingSettings.md new file mode 100644 index 00000000..f932f68f --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestTrackingSettings.md @@ -0,0 +1,14 @@ +# SendMailRequestTrackingSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClickTracking** | [**SendMailRequestTrackingSettingsClickTracking**](SendMailRequestTrackingSettingsClickTracking.md) | |[optional] +**OpenTracking** | [**SendMailRequestTrackingSettingsOpenTracking**](SendMailRequestTrackingSettingsOpenTracking.md) | |[optional] +**SubscriptionTracking** | [**SendMailRequestTrackingSettingsSubscriptionTracking**](SendMailRequestTrackingSettingsSubscriptionTracking.md) | |[optional] +**Ganalytics** | [**SendMailRequestTrackingSettingsGanalytics**](SendMailRequestTrackingSettingsGanalytics.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsClickTracking.md b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsClickTracking.md new file mode 100644 index 00000000..ddcd5c9c --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsClickTracking.md @@ -0,0 +1,12 @@ +# SendMailRequestTrackingSettingsClickTracking + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] +**EnableText** | **bool** | Indicates if this setting should be included in the `text/plain` portion of your email. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsGanalytics.md b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsGanalytics.md new file mode 100644 index 00000000..48a45e0f --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsGanalytics.md @@ -0,0 +1,16 @@ +# SendMailRequestTrackingSettingsGanalytics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] +**UtmSource** | **string** | Name of the referrer source. (e.g., Google, SomeDomain.com, or Marketing Email) |[optional] +**UtmMedium** | **string** | Name of the marketing medium. (e.g., Email) |[optional] +**UtmTerm** | **string** | Used to identify any paid keywords. |[optional] +**UtmContent** | **string** | Used to differentiate your campaign from advertisements. |[optional] +**UtmCampaign** | **string** | The name of the campaign. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsOpenTracking.md b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsOpenTracking.md new file mode 100644 index 00000000..79ee6662 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsOpenTracking.md @@ -0,0 +1,12 @@ +# SendMailRequestTrackingSettingsOpenTracking + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] +**SubstitutionTag** | **string** | Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsSubscriptionTracking.md b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsSubscriptionTracking.md new file mode 100644 index 00000000..f4bb0483 --- /dev/null +++ b/rest/api/v3/mail/docs/SendMailRequestTrackingSettingsSubscriptionTracking.md @@ -0,0 +1,14 @@ +# SendMailRequestTrackingSettingsSubscriptionTracking + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enable** | **bool** | Indicates if this setting is enabled. |[optional] +**Text** | **string** | Text to be appended to the email with the subscription tracking link. |[optional] +**Html** | **string** | HTML to be appended to the email with the subscription tracking link. |[optional] +**SubstitutionTag** | **string** | A tag that will be replaced with the unsubscribe URL. If this property is used, it will override both the `text` and `html` properties. The URL of the link will be placed at the substitution tag's location in the message body with no additional formatting. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail/model_content_encoding.go b/rest/api/v3/mail/model_content_encoding.go new file mode 100644 index 00000000..5f356d2c --- /dev/null +++ b/rest/api/v3/mail/model_content_encoding.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContentEncoding the model 'ContentEncoding' +type ContentEncoding string + +// List of ContentEncoding +const ( + CONTENTENCODING_GZIP ContentEncoding = "gzip" +) diff --git a/rest/api/v3/mail/model_disposition.go b/rest/api/v3/mail/model_disposition.go new file mode 100644 index 00000000..ca013977 --- /dev/null +++ b/rest/api/v3/mail/model_disposition.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Disposition the model 'Disposition' +type Disposition string + +// List of Disposition +const ( + DISPOSITION_INLINE Disposition = "inline" + DISPOSITION_ATTACHMENT Disposition = "attachment" +) diff --git a/rest/api/v3/mail/model_error_response.go b/rest/api/v3/mail/model_error_response.go new file mode 100644 index 00000000..e74c4c35 --- /dev/null +++ b/rest/api/v3/mail/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/mail/model_error_response_errors_inner.go b/rest/api/v3/mail/model_error_response_errors_inner.go new file mode 100644 index 00000000..d73b63c2 --- /dev/null +++ b/rest/api/v3/mail/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/mail/model_mail_batch_response.go b/rest/api/v3/mail/model_mail_batch_response.go new file mode 100644 index 00000000..5c4311c1 --- /dev/null +++ b/rest/api/v3/mail/model_mail_batch_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailBatchResponse struct for MailBatchResponse +type MailBatchResponse struct { + // A mail batch ID. + BatchId *string `json:"batch_id,omitempty"` +} diff --git a/rest/api/v3/mail/model_mail_from.go b/rest/api/v3/mail/model_mail_from.go new file mode 100644 index 00000000..e055fe14 --- /dev/null +++ b/rest/api/v3/mail/model_mail_from.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailFrom struct for MailFrom +type MailFrom struct { + // The email address from which messages are sent. This address should be a verified sender in your Twilio SendGrid account. Email addresses specified in `personalizations` will override addresses set at the message level outside of the `personalizations` object. + Email string `json:"email"` + // A name or title associated with the email address such as \"Support\" or \"Alex\". + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mail/model_mail_to.go b/rest/api/v3/mail/model_mail_to.go new file mode 100644 index 00000000..e0b3d749 --- /dev/null +++ b/rest/api/v3/mail/model_mail_to.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailTo struct for MailTo +type MailTo struct { + // An email address to which a message is sent. Email addresses specified in `personalizations` will override addresses set at the message level outside of the `personalizations` object. + Email string `json:"email"` + // A name or title associated with the email address such as \"Alex\". + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request.go b/rest/api/v3/mail/model_send_mail_request.go new file mode 100644 index 00000000..224118e1 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request.go @@ -0,0 +1,47 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequest struct for SendMailRequest +type SendMailRequest struct { + // An array of messages and their metadata. Each object within the `personalizations` array can be thought of as a mail envelope—it defines who should receive an individual message and how that message should be handled. See [**Personalizations**](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) for more information. + Personalizations []SendMailRequestPersonalizationsInner `json:"personalizations"` + From MailFrom `json:"from"` + ReplyTo *MailTo `json:"reply_to,omitempty"` + // An array of recipients to whom replies will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. You can use either the `reply_to` property or `reply_to_list` property but not both. + ReplyToList *[]MailTo `json:"reply_to_list,omitempty"` + // The global or _message level_ subject of your email. Subject lines set in personalizations objects will override this global subject line. See line length limits specified in [RFC 2822](https://www.rfc-editor.org/rfc/rfc2822#section-2.1.1) for guidance on subject line character limits. + Subject *string `json:"subject,omitempty"` + // An array of objects, each containing a message body's content and [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). You must specify at least one MIME type and may include multiple. To include more than one MIME type, add an object for each type to the array. + Content *[]SendMailRequestContentInner `json:"content,omitempty"` + // An array of objects where you can define any attachments to be included with the message. Each object contains a `content` property, which must be a Base64 encoded string of the attachment itself, and `type`, `filename`, `disposition`, and `content_id` properties that tell SendGrid how to handle the attachment. + Attachments *[]SendMailRequestAttachmentsInner `json:"attachments,omitempty"` + // An email template ID. A template that contains a subject and content—either text or html—will override any subject and content values specified at the `personalizations` or message level. If a template ID begins with `d-`, it is a dynamic template and will work with the `dynamic_template_data` property. If the template ID does not begin with `d-`, it is a standard SendGrid template and will work with the `substitutions` property. See [**How to Send an Email with Dynamic Templates**](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates) for more information about working with templates. + TemplateId *string `json:"template_id,omitempty"` + // A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`. + Headers *map[string]interface{} `json:"headers,omitempty"` + // An array of category names assigned to this message. Categories allow you to group messages by categories you define. Categories should be used sparingly to create general groups that are relevant to you. Categories are not meant to be used to track individual mail sends. For more granular categorization and tracking, use the `custom_args` property. A category name cannot exceed 255 characters. See [**Working with Categories**](https://docs.sendgrid.com/for-developers/sending-email/categories) for more information. + Categories *[]string `json:"categories,omitempty"` + // Values that are specific to the entire send that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is assigned to this property will be assumed to be the custom argument that you would like to be used. This parameter is overridden by `custom_args` set at the personalizations level. Total `custom_args` size may not exceed 10,000 bytes. + CustomArgs *string `json:"custom_args,omitempty"` + // A [unix timestamp](https://en.wikipedia.org/wiki/Unix_time) allowing you to specify when your email should be sent. A send cannot be scheduled more than 72 hours in advance. This property may be overridden by the `send_at` property set at the personalizations level. + SendAt *int32 `json:"send_at,omitempty"` + // An ID representing a batch of emails to be sent at the same time. Including a `batch_id` in your request allows you to include this email in that batch. It also enables you to cancel or pause the delivery of that batch. See the [Scheduled Sends API](https://sendgrid.com/docs/api-reference/) for more information about scheduling your email. + BatchId *string `json:"batch_id,omitempty"` + Asm *SendMailRequestAsm `json:"asm,omitempty"` + // The IP Pool that you would like to send this email from. IP Pools allow you to group your dedicated Twilio SendGrid IP addresses in order to have more control over your deliverability. See [**IP Pools**](https://docs.sendgrid.com/ui/account-and-settings/ip-pools) for more information. + IpPoolName *string `json:"ip_pool_name,omitempty"` + MailSettings *SendMailRequestMailSettings `json:"mail_settings,omitempty"` + TrackingSettings *SendMailRequestTrackingSettings `json:"tracking_settings,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_asm.go b/rest/api/v3/mail/model_send_mail_request_asm.go new file mode 100644 index 00000000..7d2afe19 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_asm.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestAsm An object allowing you to specify how to handle unsubscribes. With SendGrid, an unsubscribe is the action an email recipient takes when they opt-out of receiving your messages. A suppression is the action you take as a sender to filter or suppress an unsubscribed address from your email send. From the perspective of the recipient, your suppression is the result of their unsubscribe. See [**Suppression Groups**](https://www.twilio.com/docs/sendgrid/api-reference/suppressions-unsubscribe-groups/create-a-new-suppression-group) for more information. +type SendMailRequestAsm struct { + // The unsubscribe group to associate with this email. See the [Suppressions API](https://docs.sendgrid.com/api-reference/suppressions/) to manage unsubscribe group IDs. + GroupId int32 `json:"group_id"` + // An array containing the unsubscribe groups that you would like to be displayed to a recipient on the unsubscribe preferences page. This page is displayed in the recipient's browser when they click the unsubscribe link in your message. + GroupsToDisplay *[]int32 `json:"groups_to_display,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_attachments_inner.go b/rest/api/v3/mail/model_send_mail_request_attachments_inner.go new file mode 100644 index 00000000..9c39ef33 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_attachments_inner.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestAttachmentsInner struct for SendMailRequestAttachmentsInner +type SendMailRequestAttachmentsInner struct { + // The Base64 encoded content of the attachment. + Content string `json:"content"` + // The MIME type of the content you are attaching (e.g., `image/jpeg` or `application/pdf`). + Type *string `json:"type,omitempty"` + // The attachment's filename, including the file extension. + Filename string `json:"filename"` + // The attachment's content-disposition specifies how you would like the attachment to be displayed. For example, `inline` results in the attached file being displayed automatically within the message while `attachment` results in the attached file requiring some action to be taken before it is displayed such as opening or downloading the file. + Disposition *Disposition `json:"disposition,omitempty"` + // The attachment's content ID. The `content_id` is used when the `disposition` is set to `inline` and the attachment is an image, allowing the file to be displayed within the body of the email. + ContentId *string `json:"content_id,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_content_inner.go b/rest/api/v3/mail/model_send_mail_request_content_inner.go new file mode 100644 index 00000000..e5377596 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_content_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestContentInner struct for SendMailRequestContentInner +type SendMailRequestContentInner struct { + // The MIME type of the content assigned in the `value` property of this object (e.g., `text/plain` or `text/html`). + Type string `json:"type"` + // The content of your message in the specified MIME type assigned in the `type` property of this object. + Value string `json:"value"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_mail_settings.go b/rest/api/v3/mail/model_send_mail_request_mail_settings.go new file mode 100644 index 00000000..b1ecabc9 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_mail_settings.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestMailSettings A collection of different mail settings that you can use to specify how you would like this email to be handled. Mail settings provide extra functionality to your mail send. See [**Mail Settings**](https://docs.sendgrid.com/ui/account-and-settings/mail) for more information. +type SendMailRequestMailSettings struct { + BypassListManagement *SendMailRequestMailSettingsBypassListManagement `json:"bypass_list_management,omitempty"` + BypassSpamManagement *SendMailRequestMailSettingsBypassSpamManagement `json:"bypass_spam_management,omitempty"` + BypassBounceManagement *SendMailRequestMailSettingsBypassBounceManagement `json:"bypass_bounce_management,omitempty"` + BypassUnsubscribeManagement *SendMailRequestMailSettingsBypassUnsubscribeManagement `json:"bypass_unsubscribe_management,omitempty"` + Footer *SendMailRequestMailSettingsFooter `json:"footer,omitempty"` + SandboxMode *SendMailRequestMailSettingsSandboxMode `json:"sandbox_mode,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_bounce_management.go b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_bounce_management.go new file mode 100644 index 00000000..7eb6b77e --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_bounce_management.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestMailSettingsBypassBounceManagement Allows you to bypass the bounce list to ensure that the email is delivered to recipients. Spam report and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypass_list_management` filter. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters. +type SendMailRequestMailSettingsBypassBounceManagement struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_list_management.go b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_list_management.go new file mode 100644 index 00000000..c838c86b --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_list_management.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestMailSettingsBypassListManagement Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. This should only be used in emergencies when it is absolutely necessary that every recipient receives your email. This filter cannot be combined with any other bypass filters. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters. +type SendMailRequestMailSettingsBypassListManagement struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_spam_management.go b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_spam_management.go new file mode 100644 index 00000000..0a81e09a --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_spam_management.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestMailSettingsBypassSpamManagement Allows you to bypass the spam report list to ensure that the email is delivered to recipients. Bounce and unsubscribe lists will still be checked; addresses on these other lists will not receive the message. This filter cannot be combined with the `bypass_list_management` filter. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters. +type SendMailRequestMailSettingsBypassSpamManagement struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_unsubscribe_management.go b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_unsubscribe_management.go new file mode 100644 index 00000000..b4990d41 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_mail_settings_bypass_unsubscribe_management.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestMailSettingsBypassUnsubscribeManagement Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. Bounce and spam report lists will still be checked; addresses on these other lists will not receive the message. This filter applies only to global unsubscribes and will not bypass group unsubscribes. This filter cannot be combined with the `bypass_list_management` filter. See the [the \"Bypass suppressions\" section of our **Suppressions Overview**](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#bypass-suppressions) for more about bypass filters. +type SendMailRequestMailSettingsBypassUnsubscribeManagement struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_mail_settings_footer.go b/rest/api/v3/mail/model_send_mail_request_mail_settings_footer.go new file mode 100644 index 00000000..b0fa2858 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_mail_settings_footer.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestMailSettingsFooter Inserts a custom footer at the bottom of the text and HTML bodies of your messages. Use the `html` and `text` properties to include the content of the footers to be inserted. +type SendMailRequestMailSettingsFooter struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` + // The plain text content of your footer. + Text *string `json:"text,omitempty"` + // The HTML content of your footer. + Html *string `json:"html,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_mail_settings_sandbox_mode.go b/rest/api/v3/mail/model_send_mail_request_mail_settings_sandbox_mode.go new file mode 100644 index 00000000..f69f6280 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_mail_settings_sandbox_mode.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestMailSettingsSandboxMode Sandbox Mode allows you to send a test email to ensure that your request body is valid and formatted correctly. +type SendMailRequestMailSettingsSandboxMode struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_personalizations_inner.go b/rest/api/v3/mail/model_send_mail_request_personalizations_inner.go new file mode 100644 index 00000000..ebcbc7d5 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_personalizations_inner.go @@ -0,0 +1,37 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestPersonalizationsInner struct for SendMailRequestPersonalizationsInner +type SendMailRequestPersonalizationsInner struct { + From *MailFrom `json:"from,omitempty"` + // An array of recipients to whom the email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. + To []MailTo `json:"to"` + // An array of recipients to whom a copy of the email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. + Cc *[]MailTo `json:"cc,omitempty"` + // An array of recipients to whom a blind carbon copy of your email will be sent. Each object in this array must contain a recipient's email address. Each object in the array may optionally contain a recipient's name. + Bcc *[]MailTo `json:"bcc,omitempty"` + // The subject of your email. See line length limits specified in [RFC 2822](https://www.rfc-editor.org/rfc/rfc2822#section-2.1.1) for guidance on subject line character limits. + Subject *string `json:"subject,omitempty"` + // A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. You may not override the following headers: `x-sg-id`, `x-sg-eid`, `received`, `dkim-signature`, `Content-Type`, `Content-Transfer-Encoding`, `To`, `From`, `Subject`, `Reply-To`, `CC`, `BCC`. + Headers *map[string]interface{} `json:"headers,omitempty"` + // A collection property names that will be substituted by their corresponding property values in the `subject`, `reply-to` and `content` portions of your message. Name and value pairs follow the pattern `\"substitution_tag\":\"value to substitute\"`. The total collective size of your substitutions may not exceed 10,000 bytes per personalization object. Substitutions allow you to insert data without using SendGrid's Dynamic Templates. This property should not be used in combination with a Dynamic Template, which can be identified by a `template_id` starting with `d-`. See [**Substitution Tags**](https://docs.sendgrid.com/for-developers/sending-email/substitution-tags) for more information. + Substitutions *map[string]string `json:"substitutions,omitempty"` + // A collection property names that will be substituted by their corresponding property values in the `subject`, `reply-to` and `content` portions of a SendGrid Dynamic Template. Dynamic template data is available in a template using [Handlebars](https://docs.sendgrid.com/for-developers/sending-email/using-handlebars) syntax. This property should be used in combination with a Dynamic Template, which can be identified by a `template_id` starting with `d-`. See [**How to Send an Email with Dynamic Templates**](https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates) for more information. + DynamicTemplateData *map[string]interface{} `json:"dynamic_template_data,omitempty"` + // Values that are specific to this personalization that will be carried along with the email and its activity data. Substitutions will not be made on custom arguments, so any string that is assigned to this property will be assumed to be the custom argument that you would like to be used. This field may not exceed 10,000 bytes. + CustomArgs *map[string]interface{} `json:"custom_args,omitempty"` + // A [unix timestamp](https://en.wikipedia.org/wiki/Unix_time) allowing you to specify when your email should be sent. A send cannot be scheduled more than 72 hours in advance. + SendAt *int32 `json:"send_at,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_tracking_settings.go b/rest/api/v3/mail/model_send_mail_request_tracking_settings.go new file mode 100644 index 00000000..70621f0e --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_tracking_settings.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestTrackingSettings Settings to determine how you would like to track the metrics of how your recipients interact with your email. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +type SendMailRequestTrackingSettings struct { + ClickTracking *SendMailRequestTrackingSettingsClickTracking `json:"click_tracking,omitempty"` + OpenTracking *SendMailRequestTrackingSettingsOpenTracking `json:"open_tracking,omitempty"` + SubscriptionTracking *SendMailRequestTrackingSettingsSubscriptionTracking `json:"subscription_tracking,omitempty"` + Ganalytics *SendMailRequestTrackingSettingsGanalytics `json:"ganalytics,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_tracking_settings_click_tracking.go b/rest/api/v3/mail/model_send_mail_request_tracking_settings_click_tracking.go new file mode 100644 index 00000000..6c9c7e17 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_tracking_settings_click_tracking.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestTrackingSettingsClickTracking Allows you to track if a recipient clicked a link in your email. +type SendMailRequestTrackingSettingsClickTracking struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` + // Indicates if this setting should be included in the `text/plain` portion of your email. + EnableText *bool `json:"enable_text,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_tracking_settings_ganalytics.go b/rest/api/v3/mail/model_send_mail_request_tracking_settings_ganalytics.go new file mode 100644 index 00000000..d3533334 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_tracking_settings_ganalytics.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestTrackingSettingsGanalytics Allows you to enable tracking provided by Google Analytics. See [**Google Analytics and SendGrid Statistics**](https://docs.sendgrid.com/ui/analytics-and-reporting/google-analytics) for more information about this property. +type SendMailRequestTrackingSettingsGanalytics struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` + // Name of the referrer source. (e.g., Google, SomeDomain.com, or Marketing Email) + UtmSource *string `json:"utm_source,omitempty"` + // Name of the marketing medium. (e.g., Email) + UtmMedium *string `json:"utm_medium,omitempty"` + // Used to identify any paid keywords. + UtmTerm *string `json:"utm_term,omitempty"` + // Used to differentiate your campaign from advertisements. + UtmContent *string `json:"utm_content,omitempty"` + // The name of the campaign. + UtmCampaign *string `json:"utm_campaign,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_tracking_settings_open_tracking.go b/rest/api/v3/mail/model_send_mail_request_tracking_settings_open_tracking.go new file mode 100644 index 00000000..90d6421e --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_tracking_settings_open_tracking.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestTrackingSettingsOpenTracking Allows you to track if the email was opened by including a single transparent pixel image in the body of the message content. When the message is opened, a request for the pixel is sent. That request indicates to Twilio SendGrid that the message was opened. +type SendMailRequestTrackingSettingsOpenTracking struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` + // Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. This tag will be replaced by the open tracking pixel. + SubstitutionTag *string `json:"substitution_tag,omitempty"` +} diff --git a/rest/api/v3/mail/model_send_mail_request_tracking_settings_subscription_tracking.go b/rest/api/v3/mail/model_send_mail_request_tracking_settings_subscription_tracking.go new file mode 100644 index 00000000..be8695e1 --- /dev/null +++ b/rest/api/v3/mail/model_send_mail_request_tracking_settings_subscription_tracking.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail API +* The Twilio SendGrid v3 Mail API allows you to send email at scale over HTTP. The Mail Send endpoint supports many levels of functionality, allowing you to send templates, set categories and custom arguments that can be used to analyze your send, and configure which tracking settings to include such as opens and clicks. You can also group mail sends into batches, allowing you to schedule and cancel sends by their batch IDs. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendMailRequestTrackingSettingsSubscriptionTracking Allows you to insert a subscription management link at the bottom of the text and HTML bodies of your email. If you would like to specify the location of the link within your email, you may use the `substitution_tag` property. +type SendMailRequestTrackingSettingsSubscriptionTracking struct { + // Indicates if this setting is enabled. + Enable *bool `json:"enable,omitempty"` + // Text to be appended to the email with the subscription tracking link. + Text *string `json:"text,omitempty"` + // HTML to be appended to the email with the subscription tracking link. + Html *string `json:"html,omitempty"` + // A tag that will be replaced with the unsubscribe URL. If this property is used, it will override both the `text` and `html` properties. The URL of the link will be placed at the substitution tag's location in the message body with no additional formatting. + SubstitutionTag *string `json:"substitution_tag,omitempty"` +} diff --git a/rest/api/v3/mail_settings/README.md b/rest/api/v3/mail_settings/README.md new file mode 100644 index 00000000..0ea4bce1 --- /dev/null +++ b/rest/api/v3/mail_settings/README.md @@ -0,0 +1,86 @@ +# Go API client for + +The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. + +For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). + +You can also manage your Mail Settings in the Twilio SendGrid application user interface. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:01.948903+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ListAddressWhitelist* | [**ListAddressWhitelist**](docs/ListAddressWhitelist.md#listaddresswhitelist) | **Get** /v3/mail_settings/address_whitelist | Retrieve address whitelist mail settings +*ListBouncePurge* | [**ListBouncePurge**](docs/ListBouncePurge.md#listbouncepurge) | **Get** /v3/mail_settings/bounce_purge | Retrieve bounce purge mail settings +*ListFooter* | [**ListFooter**](docs/ListFooter.md#listfooter) | **Get** /v3/mail_settings/footer | Retrieve footer mail settings +*ListForwardBounce* | [**ListForwardBounce**](docs/ListForwardBounce.md#listforwardbounce) | **Get** /v3/mail_settings/forward_bounce | Retrieve forward bounce mail settings +*ListForwardSpam* | [**ListForwardSpam**](docs/ListForwardSpam.md#listforwardspam) | **Get** /v3/mail_settings/forward_spam | Retrieve forward spam mail settings +*ListMailSetting* | [**ListMailSetting**](docs/ListMailSetting.md#listmailsetting) | **Get** /v3/mail_settings | Retrieve all mail settings +*ListTemplate* | [**ListTemplate**](docs/ListTemplate.md#listtemplate) | **Get** /v3/mail_settings/template | Retrieve legacy template mail settings +*UpdateAddressWhitelist* | [**UpdateAddressWhitelist**](docs/UpdateAddressWhitelist.md#updateaddresswhitelist) | **Patch** /v3/mail_settings/address_whitelist | Update address whitelist mail settings +*UpdateBouncePurge* | [**UpdateBouncePurge**](docs/UpdateBouncePurge.md#updatebouncepurge) | **Patch** /v3/mail_settings/bounce_purge | Update bounce purge mail settings +*UpdateFooter* | [**UpdateFooter**](docs/UpdateFooter.md#updatefooter) | **Patch** /v3/mail_settings/footer | Update footer mail settings +*UpdateForwardBounce* | [**UpdateForwardBounce**](docs/UpdateForwardBounce.md#updateforwardbounce) | **Patch** /v3/mail_settings/forward_bounce | Update forward bounce mail settings +*UpdateForwardSpam* | [**UpdateForwardSpam**](docs/UpdateForwardSpam.md#updateforwardspam) | **Patch** /v3/mail_settings/forward_spam | Update forward spam mail settings +*UpdateTemplate* | [**UpdateTemplate**](docs/UpdateTemplate.md#updatetemplate) | **Patch** /v3/mail_settings/template | Update template mail settings + + +## Documentation For Models + + - [ListMailSetting200Response](ListMailSetting200Response.md) + - [ListMailSetting200ResponseResultInner](ListMailSetting200ResponseResultInner.md) + - [MailSettingsAddressWhitelabel200](MailSettingsAddressWhitelabel200.md) + - [MailSettingsBouncePurge](MailSettingsBouncePurge.md) + - [MailSettingsFooter](MailSettingsFooter.md) + - [MailSettingsForwardBounce](MailSettingsForwardBounce.md) + - [MailSettingsForwardSpam](MailSettingsForwardSpam.md) + - [MailSettingsTemplate200](MailSettingsTemplate200.md) + - [UpdateAddressWhitelistRequest](UpdateAddressWhitelistRequest.md) + - [UpdateTemplate200Response](UpdateTemplate200Response.md) + - [UpdateTemplateRequest](UpdateTemplateRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mail_settings/api_list_address_whitelist.go b/rest/api/v3/mail_settings/api_list_address_whitelist.go new file mode 100644 index 00000000..c2421011 --- /dev/null +++ b/rest/api/v3/mail_settings/api_list_address_whitelist.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListAddressWhitelistParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListAddressWhitelistParam) SetOnbehalfof(Onbehalfof string) *ListAddressWhitelistParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current email address whitelist settings.** The Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed. For example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions. +func (c *ApiService) ListAddressWhitelist(params *ListAddressWhitelistParam) (interface{}, error) { + path := "/v3/mail_settings/address_whitelist" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsAddressWhitelabel200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_list_bounce_purge.go b/rest/api/v3/mail_settings/api_list_bounce_purge.go new file mode 100644 index 00000000..30ee837d --- /dev/null +++ b/rest/api/v3/mail_settings/api_list_bounce_purge.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListBouncePurgeParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListBouncePurgeParam) SetOnbehalfof(Onbehalfof string) *ListBouncePurgeParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current bounce and purge settings.** The Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists. A hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown. A soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full. You can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://docs.sendgrid.com/api-reference/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces). +func (c *ApiService) ListBouncePurge(params *ListBouncePurgeParam) (interface{}, error) { + path := "/v3/mail_settings/bounce_purge" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsBouncePurge{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_list_footer.go b/rest/api/v3/mail_settings/api_list_footer.go new file mode 100644 index 00000000..79f3771c --- /dev/null +++ b/rest/api/v3/mail_settings/api_list_footer.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListFooterParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListFooterParam) SetOnbehalfof(Onbehalfof string) *ListFooterParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current Footer mail settings.** The Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies. You can insert your HTML or plain text directly using the \"Update footer mail settings\" endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). +func (c *ApiService) ListFooter(params *ListFooterParam) (interface{}, error) { + path := "/v3/mail_settings/footer" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsFooter{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_list_forward_bounce.go b/rest/api/v3/mail_settings/api_list_forward_bounce.go new file mode 100644 index 00000000..83555b52 --- /dev/null +++ b/rest/api/v3/mail_settings/api_list_forward_bounce.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListForwardBounceParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListForwardBounceParam) SetOnbehalfof(Onbehalfof string) *ListForwardBounceParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current bounce forwarding mail settings.** Enabling the Forward Bounce setting allows you to specify `email` addresses to which bounce reports will be forwarded. This endpoint returns the email address you have set to receive forwarded bounces and an `enabled` status indicating if the setting is active. +func (c *ApiService) ListForwardBounce(params *ListForwardBounceParam) (interface{}, error) { + path := "/v3/mail_settings/forward_bounce" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsForwardBounce{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_list_forward_spam.go b/rest/api/v3/mail_settings/api_list_forward_spam.go new file mode 100644 index 00000000..e6871850 --- /dev/null +++ b/rest/api/v3/mail_settings/api_list_forward_spam.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListForwardSpamParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListForwardSpamParam) SetOnbehalfof(Onbehalfof string) *ListForwardSpamParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current Forward Spam mail settings.** Enabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. This endpoint returns any email address(es) you have set to receive forwarded spam and an `enabled` status indicating if the setting is active. +func (c *ApiService) ListForwardSpam(params *ListForwardSpamParam) (interface{}, error) { + path := "/v3/mail_settings/forward_spam" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsForwardSpam{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_list_mail_setting.go b/rest/api/v3/mail_settings/api_list_mail_setting.go new file mode 100644 index 00000000..fbfe8cb2 --- /dev/null +++ b/rest/api/v3/mail_settings/api_list_mail_setting.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListMailSettingParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListMailSettingParam) SetLimit(Limit int32) *ListMailSettingParam { + params.Limit = &Limit + return params +} +func (params *ListMailSettingParam) SetOffset(Offset int32) *ListMailSettingParam { + params.Offset = &Offset + return params +} +func (params *ListMailSettingParam) SetOnbehalfof(Onbehalfof string) *ListMailSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all mail settings.** Each setting will be returned with an `enabled` status set to `true` or `false` and a short description that explains what the setting does. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListMailSetting(params *ListMailSettingParam) (interface{}, error) { + path := "/v3/mail_settings" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListMailSetting200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_list_template.go b/rest/api/v3/mail_settings/api_list_template.go new file mode 100644 index 00000000..d03cd5ef --- /dev/null +++ b/rest/api/v3/mail_settings/api_list_template.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListTemplateParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListTemplateParam) SetOnbehalfof(Onbehalfof string) *ListTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current legacy email template settings.** This setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to [\"Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see [\"Migrating from Legacy Templates\"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/). +func (c *ApiService) ListTemplate(params *ListTemplateParam) (interface{}, error) { + path := "/v3/mail_settings/template" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsTemplate200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_service.go b/rest/api/v3/mail_settings/api_service.go new file mode 100644 index 00000000..e9a35ea3 --- /dev/null +++ b/rest/api/v3/mail_settings/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mail_settings/api_update_address_whitelist.go b/rest/api/v3/mail_settings/api_update_address_whitelist.go new file mode 100644 index 00000000..8acf2d8b --- /dev/null +++ b/rest/api/v3/mail_settings/api_update_address_whitelist.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateAddressWhitelistParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateAddressWhitelistRequest *UpdateAddressWhitelistRequest `json:"UpdateAddressWhitelistRequest,omitempty"` +} + +func (params *UpdateAddressWhitelistParam) SetOnbehalfof(Onbehalfof string) *UpdateAddressWhitelistParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateAddressWhitelistParam) SetUpdateAddressWhitelistRequest(UpdateAddressWhitelistRequest UpdateAddressWhitelistRequest) *UpdateAddressWhitelistParam { + params.UpdateAddressWhitelistRequest = &UpdateAddressWhitelistRequest + return params +} + +// **This endpoint allows you to update your current email address whitelist settings.** You can select whether or not this setting should be enabled by assigning the `enabled` field a `true` or `false` value. Passing only the `enabled` field to this endpoint will not alter your current `list` of whitelist entries. However, any modifications to your `list` of entries will overwrite the entire list. For this reason, you must included all existing entries you wish to retain in your `list` in addition to any new entries you intend to add. To remove one or more `list` entries, pass a `list` with only the entries you wish to retain. You should not add generic domains such as `gmail.com` or `yahoo.com` in your `list` because your emails will not honor recipients' unsubscribes. This may cause a legal violation of [CAN-SPAM](https://sendgrid.com/docs/glossary/can-spam/) and could damage your sending reputation. The Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed. For example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions. +func (c *ApiService) UpdateAddressWhitelist(params *UpdateAddressWhitelistParam) (interface{}, error) { + path := "/v3/mail_settings/address_whitelist" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateAddressWhitelistRequest != nil { + b, err := json.Marshal(*params.UpdateAddressWhitelistRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsAddressWhitelabel200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_update_bounce_purge.go b/rest/api/v3/mail_settings/api_update_bounce_purge.go new file mode 100644 index 00000000..80f822e2 --- /dev/null +++ b/rest/api/v3/mail_settings/api_update_bounce_purge.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateBouncePurgeParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + MailSettingsBouncePurge *MailSettingsBouncePurge `json:"MailSettingsBouncePurge,omitempty"` +} + +func (params *UpdateBouncePurgeParam) SetOnbehalfof(Onbehalfof string) *UpdateBouncePurgeParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateBouncePurgeParam) SetMailSettingsBouncePurge(MailSettingsBouncePurge MailSettingsBouncePurge) *UpdateBouncePurgeParam { + params.MailSettingsBouncePurge = &MailSettingsBouncePurge + return params +} + +// **This endpoint allows you to update your current bounce and purge settings.** The Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists. The schedule is set in full days by assigning the number of days, an integer, to the `soft_bounces` and/or `hard_bounces` fields. A hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown. A soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full. You can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://docs.sendgrid.com/api-reference/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces). +func (c *ApiService) UpdateBouncePurge(params *UpdateBouncePurgeParam) (interface{}, error) { + path := "/v3/mail_settings/bounce_purge" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.MailSettingsBouncePurge != nil { + b, err := json.Marshal(*params.MailSettingsBouncePurge) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsBouncePurge{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_update_footer.go b/rest/api/v3/mail_settings/api_update_footer.go new file mode 100644 index 00000000..9d6bcf09 --- /dev/null +++ b/rest/api/v3/mail_settings/api_update_footer.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateFooterParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + MailSettingsFooter *MailSettingsFooter `json:"MailSettingsFooter,omitempty"` +} + +func (params *UpdateFooterParam) SetOnbehalfof(Onbehalfof string) *UpdateFooterParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateFooterParam) SetMailSettingsFooter(MailSettingsFooter MailSettingsFooter) *UpdateFooterParam { + params.MailSettingsFooter = &MailSettingsFooter + return params +} + +// **This endpoint allows you to update your current Footer mail settings.** The Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies. You can insert your HTML or plain text directly using this endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). +func (c *ApiService) UpdateFooter(params *UpdateFooterParam) (interface{}, error) { + path := "/v3/mail_settings/footer" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.MailSettingsFooter != nil { + b, err := json.Marshal(*params.MailSettingsFooter) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsFooter{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_update_forward_bounce.go b/rest/api/v3/mail_settings/api_update_forward_bounce.go new file mode 100644 index 00000000..7288ee75 --- /dev/null +++ b/rest/api/v3/mail_settings/api_update_forward_bounce.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateForwardBounceParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + MailSettingsForwardBounce *MailSettingsForwardBounce `json:"MailSettingsForwardBounce,omitempty"` +} + +func (params *UpdateForwardBounceParam) SetOnbehalfof(Onbehalfof string) *UpdateForwardBounceParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateForwardBounceParam) SetMailSettingsForwardBounce(MailSettingsForwardBounce MailSettingsForwardBounce) *UpdateForwardBounceParam { + params.MailSettingsForwardBounce = &MailSettingsForwardBounce + return params +} + +// **This endpoint allows you to update your current bounce forwarding mail settings.** Enabling the Forward Bounce setting allows you to specify an `email` address to which bounce reports will be forwarded. You can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). +func (c *ApiService) UpdateForwardBounce(params *UpdateForwardBounceParam) (interface{}, error) { + path := "/v3/mail_settings/forward_bounce" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.MailSettingsForwardBounce != nil { + b, err := json.Marshal(*params.MailSettingsForwardBounce) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsForwardBounce{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_update_forward_spam.go b/rest/api/v3/mail_settings/api_update_forward_spam.go new file mode 100644 index 00000000..06bf9f29 --- /dev/null +++ b/rest/api/v3/mail_settings/api_update_forward_spam.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateForwardSpamParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + MailSettingsForwardSpam *MailSettingsForwardSpam `json:"MailSettingsForwardSpam,omitempty"` +} + +func (params *UpdateForwardSpamParam) SetOnbehalfof(Onbehalfof string) *UpdateForwardSpamParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateForwardSpamParam) SetMailSettingsForwardSpam(MailSettingsForwardSpam MailSettingsForwardSpam) *UpdateForwardSpamParam { + params.MailSettingsForwardSpam = &MailSettingsForwardSpam + return params +} + +// **This endpoint allows you to update your current Forward Spam mail settings.** Enabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. You can set multiple addresses by passing this endpoint a comma separated list of emails in a single string. ``` { \"email\": \"address1@example.com, address2@exapmle.com\", \"enabled\": true } ``` The Forward Spam setting may also be used to receive emails sent to `abuse@` and `postmaster@` role addresses if you have authenticated your domain. For example, if you authenticated `example.com` as your root domain and set a custom return path of `sub` for that domain, you could turn on Forward Spam, and any emails sent to `abuse@sub.example.com` or `postmaster@sub.example.com` would be forwarded to the email address you entered in the `email` field. You can authenticate your domain using the \"Authenticate a domain\" endpoint or in the [Sender Authentication section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth). You can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). +func (c *ApiService) UpdateForwardSpam(params *UpdateForwardSpamParam) (interface{}, error) { + path := "/v3/mail_settings/forward_spam" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.MailSettingsForwardSpam != nil { + b, err := json.Marshal(*params.MailSettingsForwardSpam) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &MailSettingsForwardSpam{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/api_update_template.go b/rest/api/v3/mail_settings/api_update_template.go new file mode 100644 index 00000000..aff59dcb --- /dev/null +++ b/rest/api/v3/mail_settings/api_update_template.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateTemplateParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateTemplateRequest *UpdateTemplateRequest `json:"UpdateTemplateRequest,omitempty"` +} + +func (params *UpdateTemplateParam) SetOnbehalfof(Onbehalfof string) *UpdateTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateTemplateParam) SetUpdateTemplateRequest(UpdateTemplateRequest UpdateTemplateRequest) *UpdateTemplateParam { + params.UpdateTemplateRequest = &UpdateTemplateRequest + return params +} + +// **This endpoint allows you to update your current legacy email template settings.** This setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to [\"Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see [\"Migrating from Legacy Templates\"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/). +func (c *ApiService) UpdateTemplate(params *UpdateTemplateParam) (interface{}, error) { + path := "/v3/mail_settings/template" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateTemplateRequest != nil { + b, err := json.Marshal(*params.UpdateTemplateRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateTemplate200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mail_settings/docs/ListAddressWhitelist.md b/rest/api/v3/mail_settings/docs/ListAddressWhitelist.md new file mode 100644 index 00000000..19d14d6b --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListAddressWhitelist.md @@ -0,0 +1,48 @@ +# ListAddressWhitelist + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAddressWhitelist**](ListAddressWhitelist.md#ListAddressWhitelist) | **Get** /v3/mail_settings/address_whitelist | Retrieve address whitelist mail settings + + + +## ListAddressWhitelist + +> MailSettingsAddressWhitelabel200 ListAddressWhitelist(ctx, optional) + +Retrieve address whitelist mail settings + +**This endpoint allows you to retrieve your current email address whitelist settings.** The Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed. For example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAddressWhitelistParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**MailSettingsAddressWhitelabel200**](MailSettingsAddressWhitelabel200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/ListBouncePurge.md b/rest/api/v3/mail_settings/docs/ListBouncePurge.md new file mode 100644 index 00000000..edf160c3 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListBouncePurge.md @@ -0,0 +1,48 @@ +# ListBouncePurge + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListBouncePurge**](ListBouncePurge.md#ListBouncePurge) | **Get** /v3/mail_settings/bounce_purge | Retrieve bounce purge mail settings + + + +## ListBouncePurge + +> MailSettingsBouncePurge ListBouncePurge(ctx, optional) + +Retrieve bounce purge mail settings + +**This endpoint allows you to retrieve your current bounce and purge settings.** The Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists. A hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown. A soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full. You can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://docs.sendgrid.com/api-reference/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListBouncePurgeParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**MailSettingsBouncePurge**](MailSettingsBouncePurge.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/ListFooter.md b/rest/api/v3/mail_settings/docs/ListFooter.md new file mode 100644 index 00000000..67d15a65 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListFooter.md @@ -0,0 +1,48 @@ +# ListFooter + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListFooter**](ListFooter.md#ListFooter) | **Get** /v3/mail_settings/footer | Retrieve footer mail settings + + + +## ListFooter + +> MailSettingsFooter ListFooter(ctx, optional) + +Retrieve footer mail settings + +**This endpoint allows you to retrieve your current Footer mail settings.** The Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies. You can insert your HTML or plain text directly using the \"Update footer mail settings\" endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListFooterParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**MailSettingsFooter**](MailSettingsFooter.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/ListForwardBounce.md b/rest/api/v3/mail_settings/docs/ListForwardBounce.md new file mode 100644 index 00000000..03f8edb4 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListForwardBounce.md @@ -0,0 +1,48 @@ +# ListForwardBounce + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListForwardBounce**](ListForwardBounce.md#ListForwardBounce) | **Get** /v3/mail_settings/forward_bounce | Retrieve forward bounce mail settings + + + +## ListForwardBounce + +> MailSettingsForwardBounce ListForwardBounce(ctx, optional) + +Retrieve forward bounce mail settings + +**This endpoint allows you to retrieve your current bounce forwarding mail settings.** Enabling the Forward Bounce setting allows you to specify `email` addresses to which bounce reports will be forwarded. This endpoint returns the email address you have set to receive forwarded bounces and an `enabled` status indicating if the setting is active. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListForwardBounceParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**MailSettingsForwardBounce**](MailSettingsForwardBounce.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/ListForwardSpam.md b/rest/api/v3/mail_settings/docs/ListForwardSpam.md new file mode 100644 index 00000000..8a50b2a3 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListForwardSpam.md @@ -0,0 +1,48 @@ +# ListForwardSpam + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListForwardSpam**](ListForwardSpam.md#ListForwardSpam) | **Get** /v3/mail_settings/forward_spam | Retrieve forward spam mail settings + + + +## ListForwardSpam + +> MailSettingsForwardSpam ListForwardSpam(ctx, optional) + +Retrieve forward spam mail settings + +**This endpoint allows you to retrieve your current Forward Spam mail settings.** Enabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. This endpoint returns any email address(es) you have set to receive forwarded spam and an `enabled` status indicating if the setting is active. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListForwardSpamParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**MailSettingsForwardSpam**](MailSettingsForwardSpam.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/ListMailSetting.md b/rest/api/v3/mail_settings/docs/ListMailSetting.md new file mode 100644 index 00000000..112b7db3 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListMailSetting.md @@ -0,0 +1,50 @@ +# ListMailSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListMailSetting**](ListMailSetting.md#ListMailSetting) | **Get** /v3/mail_settings | Retrieve all mail settings + + + +## ListMailSetting + +> ListMailSetting200Response ListMailSetting(ctx, optional) + +Retrieve all mail settings + +**This endpoint allows you to retrieve a paginated list of all mail settings.** Each setting will be returned with an `enabled` status set to `true` or `false` and a short description that explains what the setting does. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListMailSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListMailSetting200Response**](ListMailSetting200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/ListMailSetting200Response.md b/rest/api/v3/mail_settings/docs/ListMailSetting200Response.md new file mode 100644 index 00000000..cbfa419e --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListMailSetting200Response.md @@ -0,0 +1,11 @@ +# ListMailSetting200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListMailSetting200ResponseResultInner**](ListMailSetting200ResponseResultInner.md) | The list of all mail settings. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/ListMailSetting200ResponseResultInner.md b/rest/api/v3/mail_settings/docs/ListMailSetting200ResponseResultInner.md new file mode 100644 index 00000000..ffcbe98a --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListMailSetting200ResponseResultInner.md @@ -0,0 +1,14 @@ +# ListMailSetting200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | **string** | The title of the mail setting. | +**Enabled** | **bool** | Indicates if this mail setting is currently enabled. | +**Name** | **string** | The name of the mail setting. | +**Description** | **string** | A description of the mail setting. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/ListTemplate.md b/rest/api/v3/mail_settings/docs/ListTemplate.md new file mode 100644 index 00000000..d793d851 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/ListTemplate.md @@ -0,0 +1,48 @@ +# ListTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListTemplate**](ListTemplate.md#ListTemplate) | **Get** /v3/mail_settings/template | Retrieve legacy template mail settings + + + +## ListTemplate + +> MailSettingsTemplate200 ListTemplate(ctx, optional) + +Retrieve legacy template mail settings + +**This endpoint allows you to retrieve your current legacy email template settings.** This setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to [\"Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see [\"Migrating from Legacy Templates\"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**MailSettingsTemplate200**](MailSettingsTemplate200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/MailSettingsAddressWhitelabel200.md b/rest/api/v3/mail_settings/docs/MailSettingsAddressWhitelabel200.md new file mode 100644 index 00000000..faa984c3 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/MailSettingsAddressWhitelabel200.md @@ -0,0 +1,12 @@ +# MailSettingsAddressWhitelabel200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if you have an email address whitelist enabled. |[optional] +**List** | **[]string** | All email addresses that are currently on the whitelist. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/MailSettingsBouncePurge.md b/rest/api/v3/mail_settings/docs/MailSettingsBouncePurge.md new file mode 100644 index 00000000..a23734de --- /dev/null +++ b/rest/api/v3/mail_settings/docs/MailSettingsBouncePurge.md @@ -0,0 +1,13 @@ +# MailSettingsBouncePurge + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the bounce purge mail setting is enabled. |[optional] +**SoftBounces** | **int32** | The number of days after which SendGrid will purge all contacts from your soft bounces suppression lists. |[optional] +**HardBounces** | **int32** | The number of days after which SendGrid will purge all contacts from your hard bounces suppression lists. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/MailSettingsFooter.md b/rest/api/v3/mail_settings/docs/MailSettingsFooter.md new file mode 100644 index 00000000..9e32dc8d --- /dev/null +++ b/rest/api/v3/mail_settings/docs/MailSettingsFooter.md @@ -0,0 +1,13 @@ +# MailSettingsFooter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the Footer mail setting is currently enabled. |[optional] +**HtmlContent** | **string** | The custom HTML content of your email footer. |[optional] +**PlainContent** | **string** | The plain text content of your email footer. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/MailSettingsForwardBounce.md b/rest/api/v3/mail_settings/docs/MailSettingsForwardBounce.md new file mode 100644 index 00000000..b026f5b9 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/MailSettingsForwardBounce.md @@ -0,0 +1,12 @@ +# MailSettingsForwardBounce + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address that you would like your bounce reports forwarded to. |[optional] +**Enabled** | **bool** | Indicates if the bounce forwarding mail setting is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/MailSettingsForwardSpam.md b/rest/api/v3/mail_settings/docs/MailSettingsForwardSpam.md new file mode 100644 index 00000000..ab2ac86c --- /dev/null +++ b/rest/api/v3/mail_settings/docs/MailSettingsForwardSpam.md @@ -0,0 +1,12 @@ +# MailSettingsForwardSpam + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address where you would like the spam reports to be forwarded. |[optional] +**Enabled** | **bool** | Indicates if the Forward Spam setting is enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/MailSettingsTemplate200.md b/rest/api/v3/mail_settings/docs/MailSettingsTemplate200.md new file mode 100644 index 00000000..17d003ec --- /dev/null +++ b/rest/api/v3/mail_settings/docs/MailSettingsTemplate200.md @@ -0,0 +1,12 @@ +# MailSettingsTemplate200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the legacy email template setting is enabled. |[optional] +**HtmlContent** | **string** | The HTML content that you want to use for your legacy email template. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/UpdateAddressWhitelist.md b/rest/api/v3/mail_settings/docs/UpdateAddressWhitelist.md new file mode 100644 index 00000000..33b8dcda --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateAddressWhitelist.md @@ -0,0 +1,49 @@ +# UpdateAddressWhitelist + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateAddressWhitelist**](UpdateAddressWhitelist.md#UpdateAddressWhitelist) | **Patch** /v3/mail_settings/address_whitelist | Update address whitelist mail settings + + + +## UpdateAddressWhitelist + +> MailSettingsAddressWhitelabel200 UpdateAddressWhitelist(ctx, optional) + +Update address whitelist mail settings + +**This endpoint allows you to update your current email address whitelist settings.** You can select whether or not this setting should be enabled by assigning the `enabled` field a `true` or `false` value. Passing only the `enabled` field to this endpoint will not alter your current `list` of whitelist entries. However, any modifications to your `list` of entries will overwrite the entire list. For this reason, you must included all existing entries you wish to retain in your `list` in addition to any new entries you intend to add. To remove one or more `list` entries, pass a `list` with only the entries you wish to retain. You should not add generic domains such as `gmail.com` or `yahoo.com` in your `list` because your emails will not honor recipients' unsubscribes. This may cause a legal violation of [CAN-SPAM](https://sendgrid.com/docs/glossary/can-spam/) and could damage your sending reputation. The Address Whitelist setting allows you to specify email addresses or domains for which mail should never be suppressed. For example, if you own the domain `example.com`, and one or more of your recipients use `email@example.com` addresses, placing `example.com` in the address whitelist setting instructs Twilio SendGrid to ignore all bounces, blocks, and unsubscribes logged for that domain. In other words, all bounces, blocks, and unsubscribes will still be sent to `example.com` as if they were sent under normal sending conditions. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateAddressWhitelistParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateAddressWhitelistRequest** | [**UpdateAddressWhitelistRequest**](UpdateAddressWhitelistRequest.md) | + +### Return type + +[**MailSettingsAddressWhitelabel200**](MailSettingsAddressWhitelabel200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/UpdateAddressWhitelistRequest.md b/rest/api/v3/mail_settings/docs/UpdateAddressWhitelistRequest.md new file mode 100644 index 00000000..26fabf56 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateAddressWhitelistRequest.md @@ -0,0 +1,12 @@ +# UpdateAddressWhitelistRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if your email address whitelist is enabled. |[optional] +**List** | **[]string** | Either a single email address that you want whitelisted or a domain, for which all email addresses belonging to this domain will be whitelisted. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/UpdateBouncePurge.md b/rest/api/v3/mail_settings/docs/UpdateBouncePurge.md new file mode 100644 index 00000000..4ffdeafd --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateBouncePurge.md @@ -0,0 +1,49 @@ +# UpdateBouncePurge + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateBouncePurge**](UpdateBouncePurge.md#UpdateBouncePurge) | **Patch** /v3/mail_settings/bounce_purge | Update bounce purge mail settings + + + +## UpdateBouncePurge + +> MailSettingsBouncePurge UpdateBouncePurge(ctx, optional) + +Update bounce purge mail settings + +**This endpoint allows you to update your current bounce and purge settings.** The Bounce Perge setting allows you to set a schedule that Twilio SendGrid will use to automatically delete contacts from your soft and hard bounce suppression lists. The schedule is set in full days by assigning the number of days, an integer, to the `soft_bounces` and/or `hard_bounces` fields. A hard bounce occurs when an email message has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown. A soft bounce occurs when an email message reaches the recipient's mail server but is bounced back undelivered before it actually reaches the recipient. A soft bounce might occur because the recipient's inbox is full. You can also manage this setting in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). You can manage your bounces manually using the [Bounces API](https://docs.sendgrid.com/api-reference/bounces-api) or the [Bounces menu in the Twilio SendGrid App](https://app.sendgrid.com/suppressions/bounces). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateBouncePurgeParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**MailSettingsBouncePurge** | [**MailSettingsBouncePurge**](MailSettingsBouncePurge.md) | + +### Return type + +[**MailSettingsBouncePurge**](MailSettingsBouncePurge.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/UpdateFooter.md b/rest/api/v3/mail_settings/docs/UpdateFooter.md new file mode 100644 index 00000000..758cbdbd --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateFooter.md @@ -0,0 +1,49 @@ +# UpdateFooter + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateFooter**](UpdateFooter.md#UpdateFooter) | **Patch** /v3/mail_settings/footer | Update footer mail settings + + + +## UpdateFooter + +> MailSettingsFooter UpdateFooter(ctx, optional) + +Update footer mail settings + +**This endpoint allows you to update your current Footer mail settings.** The Footer setting will insert a custom footer at the bottom of your text and HTML email message bodies. You can insert your HTML or plain text directly using this endpoint, or you can create the footer using the [Mail Settings menu in the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateFooterParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**MailSettingsFooter** | [**MailSettingsFooter**](MailSettingsFooter.md) | + +### Return type + +[**MailSettingsFooter**](MailSettingsFooter.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/UpdateForwardBounce.md b/rest/api/v3/mail_settings/docs/UpdateForwardBounce.md new file mode 100644 index 00000000..f7250ada --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateForwardBounce.md @@ -0,0 +1,49 @@ +# UpdateForwardBounce + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateForwardBounce**](UpdateForwardBounce.md#UpdateForwardBounce) | **Patch** /v3/mail_settings/forward_bounce | Update forward bounce mail settings + + + +## UpdateForwardBounce + +> MailSettingsForwardBounce UpdateForwardBounce(ctx, optional) + +Update forward bounce mail settings + +**This endpoint allows you to update your current bounce forwarding mail settings.** Enabling the Forward Bounce setting allows you to specify an `email` address to which bounce reports will be forwarded. You can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateForwardBounceParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**MailSettingsForwardBounce** | [**MailSettingsForwardBounce**](MailSettingsForwardBounce.md) | + +### Return type + +[**MailSettingsForwardBounce**](MailSettingsForwardBounce.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/UpdateForwardSpam.md b/rest/api/v3/mail_settings/docs/UpdateForwardSpam.md new file mode 100644 index 00000000..72690164 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateForwardSpam.md @@ -0,0 +1,49 @@ +# UpdateForwardSpam + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateForwardSpam**](UpdateForwardSpam.md#UpdateForwardSpam) | **Patch** /v3/mail_settings/forward_spam | Update forward spam mail settings + + + +## UpdateForwardSpam + +> MailSettingsForwardSpam UpdateForwardSpam(ctx, optional) + +Update forward spam mail settings + +**This endpoint allows you to update your current Forward Spam mail settings.** Enabling the Forward Spam setting allows you to specify `email` addresses to which spam reports will be forwarded. You can set multiple addresses by passing this endpoint a comma separated list of emails in a single string. ``` { \"email\": \"address1@example.com, address2@exapmle.com\", \"enabled\": true } ``` The Forward Spam setting may also be used to receive emails sent to `abuse@` and `postmaster@` role addresses if you have authenticated your domain. For example, if you authenticated `example.com` as your root domain and set a custom return path of `sub` for that domain, you could turn on Forward Spam, and any emails sent to `abuse@sub.example.com` or `postmaster@sub.example.com` would be forwarded to the email address you entered in the `email` field. You can authenticate your domain using the \"Authenticate a domain\" endpoint or in the [Sender Authentication section of the Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth). You can also configure the Forward Spam mail settings in the [Mail Settings section of the Twilio SendGrid App](https://app.sendgrid.com/settings/mail_settings). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateForwardSpamParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**MailSettingsForwardSpam** | [**MailSettingsForwardSpam**](MailSettingsForwardSpam.md) | + +### Return type + +[**MailSettingsForwardSpam**](MailSettingsForwardSpam.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/UpdateTemplate.md b/rest/api/v3/mail_settings/docs/UpdateTemplate.md new file mode 100644 index 00000000..96add61e --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateTemplate.md @@ -0,0 +1,49 @@ +# UpdateTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateTemplate**](UpdateTemplate.md#UpdateTemplate) | **Patch** /v3/mail_settings/template | Update template mail settings + + + +## UpdateTemplate + +> UpdateTemplate200Response UpdateTemplate(ctx, optional) + +Update template mail settings + +**This endpoint allows you to update your current legacy email template settings.** This setting refers to our original email templates. We currently support more fully featured [Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. For instructions on using legacy templates, see how to [\"Create and Edit Legacy Transactional Templates](https://sendgrid.com/docs/ui/sending-email/create-and-edit-legacy-transactional-templates/). For help migrating to our current template system, see [\"Migrating from Legacy Templates\"](https://sendgrid.com/docs/ui/sending-email/migrating-from-legacy-templates/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateTemplateRequest** | [**UpdateTemplateRequest**](UpdateTemplateRequest.md) | + +### Return type + +[**UpdateTemplate200Response**](UpdateTemplate200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mail_settings/docs/UpdateTemplate200Response.md b/rest/api/v3/mail_settings/docs/UpdateTemplate200Response.md new file mode 100644 index 00000000..507108c7 --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateTemplate200Response.md @@ -0,0 +1,12 @@ +# UpdateTemplate200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the legacy email template mail setting is enabled. | +**HtmlContent** | **string** | The HTML content of your legacy email template. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/docs/UpdateTemplateRequest.md b/rest/api/v3/mail_settings/docs/UpdateTemplateRequest.md new file mode 100644 index 00000000..52fb438d --- /dev/null +++ b/rest/api/v3/mail_settings/docs/UpdateTemplateRequest.md @@ -0,0 +1,12 @@ +# UpdateTemplateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if you want to enable the legacy email template mail setting. |[optional] +**HtmlContent** | **string** | The new HTML content for your legacy email template. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mail_settings/model_list_mail_setting_200_response.go b/rest/api/v3/mail_settings/model_list_mail_setting_200_response.go new file mode 100644 index 00000000..f39bc1d9 --- /dev/null +++ b/rest/api/v3/mail_settings/model_list_mail_setting_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMailSetting200Response struct for ListMailSetting200Response +type ListMailSetting200Response struct { + // The list of all mail settings. + Result []ListMailSetting200ResponseResultInner `json:"result"` +} diff --git a/rest/api/v3/mail_settings/model_list_mail_setting_200_response_result_inner.go b/rest/api/v3/mail_settings/model_list_mail_setting_200_response_result_inner.go new file mode 100644 index 00000000..7f4d09cb --- /dev/null +++ b/rest/api/v3/mail_settings/model_list_mail_setting_200_response_result_inner.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMailSetting200ResponseResultInner struct for ListMailSetting200ResponseResultInner +type ListMailSetting200ResponseResultInner struct { + // The title of the mail setting. + Title string `json:"title"` + // Indicates if this mail setting is currently enabled. + Enabled bool `json:"enabled"` + // The name of the mail setting. + Name string `json:"name"` + // A description of the mail setting. + Description string `json:"description"` +} diff --git a/rest/api/v3/mail_settings/model_mail_settings_address_whitelabel200.go b/rest/api/v3/mail_settings/model_mail_settings_address_whitelabel200.go new file mode 100644 index 00000000..541343fc --- /dev/null +++ b/rest/api/v3/mail_settings/model_mail_settings_address_whitelabel200.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailSettingsAddressWhitelabel200 struct for MailSettingsAddressWhitelabel200 +type MailSettingsAddressWhitelabel200 struct { + // Indicates if you have an email address whitelist enabled. + Enabled *bool `json:"enabled,omitempty"` + // All email addresses that are currently on the whitelist. + List *[]string `json:"list,omitempty"` +} diff --git a/rest/api/v3/mail_settings/model_mail_settings_bounce_purge.go b/rest/api/v3/mail_settings/model_mail_settings_bounce_purge.go new file mode 100644 index 00000000..f283828f --- /dev/null +++ b/rest/api/v3/mail_settings/model_mail_settings_bounce_purge.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailSettingsBouncePurge struct for MailSettingsBouncePurge +type MailSettingsBouncePurge struct { + // Indicates if the bounce purge mail setting is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The number of days after which SendGrid will purge all contacts from your soft bounces suppression lists. + SoftBounces *int32 `json:"soft_bounces,omitempty"` + // The number of days after which SendGrid will purge all contacts from your hard bounces suppression lists. + HardBounces *int32 `json:"hard_bounces,omitempty"` +} diff --git a/rest/api/v3/mail_settings/model_mail_settings_footer.go b/rest/api/v3/mail_settings/model_mail_settings_footer.go new file mode 100644 index 00000000..b3e44acf --- /dev/null +++ b/rest/api/v3/mail_settings/model_mail_settings_footer.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailSettingsFooter struct for MailSettingsFooter +type MailSettingsFooter struct { + // Indicates if the Footer mail setting is currently enabled. + Enabled *bool `json:"enabled,omitempty"` + // The custom HTML content of your email footer. + HtmlContent *string `json:"html_content,omitempty"` + // The plain text content of your email footer. + PlainContent *string `json:"plain_content,omitempty"` +} diff --git a/rest/api/v3/mail_settings/model_mail_settings_forward_bounce.go b/rest/api/v3/mail_settings/model_mail_settings_forward_bounce.go new file mode 100644 index 00000000..6b26be5d --- /dev/null +++ b/rest/api/v3/mail_settings/model_mail_settings_forward_bounce.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailSettingsForwardBounce struct for MailSettingsForwardBounce +type MailSettingsForwardBounce struct { + // The email address that you would like your bounce reports forwarded to. + Email *string `json:"email,omitempty"` + // Indicates if the bounce forwarding mail setting is enabled. + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/rest/api/v3/mail_settings/model_mail_settings_forward_spam.go b/rest/api/v3/mail_settings/model_mail_settings_forward_spam.go new file mode 100644 index 00000000..82208334 --- /dev/null +++ b/rest/api/v3/mail_settings/model_mail_settings_forward_spam.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailSettingsForwardSpam struct for MailSettingsForwardSpam +type MailSettingsForwardSpam struct { + // The email address where you would like the spam reports to be forwarded. + Email *string `json:"email,omitempty"` + // Indicates if the Forward Spam setting is enabled. + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/rest/api/v3/mail_settings/model_mail_settings_template200.go b/rest/api/v3/mail_settings/model_mail_settings_template200.go new file mode 100644 index 00000000..b2529e26 --- /dev/null +++ b/rest/api/v3/mail_settings/model_mail_settings_template200.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailSettingsTemplate200 struct for MailSettingsTemplate200 +type MailSettingsTemplate200 struct { + // Indicates if the legacy email template setting is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The HTML content that you want to use for your legacy email template. + HtmlContent *string `json:"html_content,omitempty"` +} diff --git a/rest/api/v3/mail_settings/model_update_address_whitelist_request.go b/rest/api/v3/mail_settings/model_update_address_whitelist_request.go new file mode 100644 index 00000000..f1881e61 --- /dev/null +++ b/rest/api/v3/mail_settings/model_update_address_whitelist_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateAddressWhitelistRequest struct for UpdateAddressWhitelistRequest +type UpdateAddressWhitelistRequest struct { + // Indicates if your email address whitelist is enabled. + Enabled *bool `json:"enabled,omitempty"` + // Either a single email address that you want whitelisted or a domain, for which all email addresses belonging to this domain will be whitelisted. + List *[]string `json:"list,omitempty"` +} diff --git a/rest/api/v3/mail_settings/model_update_template_200_response.go b/rest/api/v3/mail_settings/model_update_template_200_response.go new file mode 100644 index 00000000..a879398f --- /dev/null +++ b/rest/api/v3/mail_settings/model_update_template_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateTemplate200Response struct for UpdateTemplate200Response +type UpdateTemplate200Response struct { + // Indicates if the legacy email template mail setting is enabled. + Enabled bool `json:"enabled"` + // The HTML content of your legacy email template. + HtmlContent string `json:"html_content"` +} diff --git a/rest/api/v3/mail_settings/model_update_template_request.go b/rest/api/v3/mail_settings/model_update_template_request.go new file mode 100644 index 00000000..ce310de0 --- /dev/null +++ b/rest/api/v3/mail_settings/model_update_template_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Mail Settings API +* The Twilio SendGrid Mail Settings API allows you to retrieve and configure the various Mail Settings available. Mail Settings instruct SendGrid to apply specific settings to every email that you send over [SendGrid’s Web API](https://docs.sendgrid.com/api-reference/mail-send/v3-mail-send) or [SMTP relay](https://sendgrid.com/docs/for-developers/sending-email/building-an-x-smtpapi-header/). These settings include how to embed a custom footer, how to manage blocks, spam, and bounces, and more. For a full list of Twilio SendGrid's Mail Settings, and what each one does, see [**Mail Settings**](https://sendgrid.com/docs/ui/account-and-settings/mail/). You can also manage your Mail Settings in the Twilio SendGrid application user interface. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateTemplateRequest struct for UpdateTemplateRequest +type UpdateTemplateRequest struct { + // Indicates if you want to enable the legacy email template mail setting. + Enabled *bool `json:"enabled,omitempty"` + // The new HTML content for your legacy email template. + HtmlContent *string `json:"html_content,omitempty"` +} diff --git a/rest/api/v3/mc_custom_fields/README.md b/rest/api/v3/mc_custom_fields/README.md new file mode 100644 index 00000000..11b6c285 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/README.md @@ -0,0 +1,78 @@ +# Go API client for + +The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. + +With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. + +You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.005526+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateFieldDefinition* | [**CreateFieldDefinition**](docs/CreateFieldDefinition.md#createfielddefinition) | **Post** /v3/marketing/field_definitions | Create Custom Field Definition +*DeleteFieldDefinition* | [**DeleteFieldDefinition**](docs/DeleteFieldDefinition.md#deletefielddefinition) | **Delete** /v3/marketing/field_definitions/{CustomFieldId} | Delete Custom Field Definition +*ListFieldDefinition* | [**ListFieldDefinition**](docs/ListFieldDefinition.md#listfielddefinition) | **Get** /v3/marketing/field_definitions | Get All Field Definitions +*UpdateFieldDefinition* | [**UpdateFieldDefinition**](docs/UpdateFieldDefinition.md#updatefielddefinition) | **Patch** /v3/marketing/field_definitions/{CustomFieldId} | Update Custom Field Definition + + +## Documentation For Models + + - [CreateFieldDefinition200Response](CreateFieldDefinition200Response.md) + - [CreateFieldDefinition400Response](CreateFieldDefinition400Response.md) + - [CreateFieldDefinitionRequest](CreateFieldDefinitionRequest.md) + - [CustomFieldDefinitionsResponse](CustomFieldDefinitionsResponse.md) + - [CustomFieldsError](CustomFieldsError.md) + - [FieldType](FieldType.md) + - [FieldType1](FieldType1.md) + - [FieldType2](FieldType2.md) + - [ListFieldDefinition200Response](ListFieldDefinition200Response.md) + - [Metadata](Metadata.md) + - [ReservedFieldDefinitionsResponseInner](ReservedFieldDefinitionsResponseInner.md) + - [UpdateFieldDefinitionRequest](UpdateFieldDefinitionRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_custom_fields/api_create_field_definition.go b/rest/api/v3/mc_custom_fields/api_create_field_definition.go new file mode 100644 index 00000000..ebd824b9 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/api_create_field_definition.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateFieldDefinitionParam struct { + // + CreateFieldDefinitionRequest *CreateFieldDefinitionRequest `json:"CreateFieldDefinitionRequest,omitempty"` +} + +func (params *CreateFieldDefinitionParam) SetCreateFieldDefinitionRequest(CreateFieldDefinitionRequest CreateFieldDefinitionRequest) *CreateFieldDefinitionParam { + params.CreateFieldDefinitionRequest = &CreateFieldDefinitionRequest + return params +} + +// **This endpoint creates a new custom field definition.** Custom field definitions are created with the given `name` and `field_type`. Although field names are stored in a case-sensitive manner, all field names must be case-insensitively unique. This means you may create a field named `CamelCase` or `camelcase`, but not both. Additionally, a Custom Field name cannot collide with any Reserved Field names. You should save the returned `id` value in order to update or delete the field at a later date. You can have up to 500 custom fields. The custom field name should be created using only alphanumeric characters (A-Z and 0-9) and underscores (\\_). Custom fields can only begin with letters A-Z or underscores (_). The field type can be date, text, or number fields. The field type is important for creating segments from your contact database. **Note: Creating a custom field that begins with a number will cause issues with sending in Marketing Campaigns.** +func (c *ApiService) CreateFieldDefinition(params *CreateFieldDefinitionParam) (interface{}, error) { + path := "/v3/marketing/field_definitions" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateFieldDefinitionRequest != nil { + b, err := json.Marshal(*params.CreateFieldDefinitionRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &CreateFieldDefinition200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateFieldDefinition400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_custom_fields/api_delete_field_definition.go b/rest/api/v3/mc_custom_fields/api_delete_field_definition.go new file mode 100644 index 00000000..b16b4bbf --- /dev/null +++ b/rest/api/v3/mc_custom_fields/api_delete_field_definition.go @@ -0,0 +1,61 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteFieldDefinitionParam struct { + // + CustomFieldId *string `json:"custom_field_id"` +} + +func (params *DeleteFieldDefinitionParam) SetCustomFieldId(CustomFieldId string) *DeleteFieldDefinitionParam { + params.CustomFieldId = &CustomFieldId + return params +} + +// **This endpoint deletes a defined Custom Field.** You can delete only Custom Fields; Reserved Fields cannot be deleted. +func (c *ApiService) DeleteFieldDefinition(params *DeleteFieldDefinitionParam) (interface{}, error) { + path := "/v3/marketing/field_definitions/{CustomFieldId}" + if params != nil && params.CustomFieldId != nil { + path = strings.Replace(path, "{"+"CustomFieldId"+"}", *params.CustomFieldId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 404 { + ps := &CreateFieldDefinition400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_custom_fields/api_list_field_definition.go b/rest/api/v3/mc_custom_fields/api_list_field_definition.go new file mode 100644 index 00000000..d2724fc0 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/api_list_field_definition.go @@ -0,0 +1,49 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListFieldDefinitionParam struct { +} + +// **This endpoint retrieves all defined Custom Fields and Reserved Fields.** +func (c *ApiService) ListFieldDefinition() (interface{}, error) { + path := "/v3/marketing/field_definitions" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListFieldDefinition200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_custom_fields/api_service.go b/rest/api/v3/mc_custom_fields/api_service.go new file mode 100644 index 00000000..c8f8f2a4 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_custom_fields/api_update_field_definition.go b/rest/api/v3/mc_custom_fields/api_update_field_definition.go new file mode 100644 index 00000000..a7f4164d --- /dev/null +++ b/rest/api/v3/mc_custom_fields/api_update_field_definition.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateFieldDefinitionParam struct { + // + CustomFieldId *string `json:"custom_field_id"` + // + UpdateFieldDefinitionRequest *UpdateFieldDefinitionRequest `json:"UpdateFieldDefinitionRequest,omitempty"` +} + +func (params *UpdateFieldDefinitionParam) SetCustomFieldId(CustomFieldId string) *UpdateFieldDefinitionParam { + params.CustomFieldId = &CustomFieldId + return params +} +func (params *UpdateFieldDefinitionParam) SetUpdateFieldDefinitionRequest(UpdateFieldDefinitionRequest UpdateFieldDefinitionRequest) *UpdateFieldDefinitionParam { + params.UpdateFieldDefinitionRequest = &UpdateFieldDefinitionRequest + return params +} + +// **This endpoint allows you to update a defined Custom Field.** Only your Custom fields can be modified; Reserved Fields cannot be updated. +func (c *ApiService) UpdateFieldDefinition(params *UpdateFieldDefinitionParam) (interface{}, error) { + path := "/v3/marketing/field_definitions/{CustomFieldId}" + if params != nil && params.CustomFieldId != nil { + path = strings.Replace(path, "{"+"CustomFieldId"+"}", *params.CustomFieldId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateFieldDefinitionRequest != nil { + b, err := json.Marshal(*params.UpdateFieldDefinitionRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &CreateFieldDefinition200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateFieldDefinition400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &CreateFieldDefinition400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition.md b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition.md new file mode 100644 index 00000000..08bd9259 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition.md @@ -0,0 +1,48 @@ +# CreateFieldDefinition + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateFieldDefinition**](CreateFieldDefinition.md#CreateFieldDefinition) | **Post** /v3/marketing/field_definitions | Create Custom Field Definition + + + +## CreateFieldDefinition + +> CreateFieldDefinition200Response CreateFieldDefinition(ctx, optional) + +Create Custom Field Definition + +**This endpoint creates a new custom field definition.** Custom field definitions are created with the given `name` and `field_type`. Although field names are stored in a case-sensitive manner, all field names must be case-insensitively unique. This means you may create a field named `CamelCase` or `camelcase`, but not both. Additionally, a Custom Field name cannot collide with any Reserved Field names. You should save the returned `id` value in order to update or delete the field at a later date. You can have up to 500 custom fields. The custom field name should be created using only alphanumeric characters (A-Z and 0-9) and underscores (\\_). Custom fields can only begin with letters A-Z or underscores (_). The field type can be date, text, or number fields. The field type is important for creating segments from your contact database. **Note: Creating a custom field that begins with a number will cause issues with sending in Marketing Campaigns.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateFieldDefinitionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**CreateFieldDefinitionRequest** | [**CreateFieldDefinitionRequest**](CreateFieldDefinitionRequest.md) | + +### Return type + +[**CreateFieldDefinition200Response**](CreateFieldDefinition200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition200Response.md b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition200Response.md new file mode 100644 index 00000000..a68cd18e --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition200Response.md @@ -0,0 +1,14 @@ +# CreateFieldDefinition200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | **string** | | +**FieldType** | [**FieldType2**](FieldType2.md) | | +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition400Response.md b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition400Response.md new file mode 100644 index 00000000..94eaa0b9 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinition400Response.md @@ -0,0 +1,11 @@ +# CreateFieldDefinition400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]CustomFieldsError**](CustomFieldsError.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinitionRequest.md b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinitionRequest.md new file mode 100644 index 00000000..c1198cfc --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/CreateFieldDefinitionRequest.md @@ -0,0 +1,12 @@ +# CreateFieldDefinitionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | +**FieldType** | [**FieldType**](FieldType.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/CustomFieldDefinitionsResponse.md b/rest/api/v3/mc_custom_fields/docs/CustomFieldDefinitionsResponse.md new file mode 100644 index 00000000..c899e1bd --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/CustomFieldDefinitionsResponse.md @@ -0,0 +1,13 @@ +# CustomFieldDefinitionsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | **string** | | +**FieldType** | [**FieldType2**](FieldType2.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/CustomFieldsError.md b/rest/api/v3/mc_custom_fields/docs/CustomFieldsError.md new file mode 100644 index 00000000..efda7914 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/CustomFieldsError.md @@ -0,0 +1,14 @@ +# CustomFieldsError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**Field** | **string** | |[optional] +**ErrorId** | **string** | |[optional] +**Parameter** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/DeleteFieldDefinition.md b/rest/api/v3/mc_custom_fields/docs/DeleteFieldDefinition.md new file mode 100644 index 00000000..4d760132 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/DeleteFieldDefinition.md @@ -0,0 +1,51 @@ +# DeleteFieldDefinition + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteFieldDefinition**](DeleteFieldDefinition.md#DeleteFieldDefinition) | **Delete** /v3/marketing/field_definitions/{CustomFieldId} | Delete Custom Field Definition + + + +## DeleteFieldDefinition + +> DeleteFieldDefinition(ctx, CustomFieldId) + +Delete Custom Field Definition + +**This endpoint deletes a defined Custom Field.** You can delete only Custom Fields; Reserved Fields cannot be deleted. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CustomFieldId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteFieldDefinitionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_custom_fields/docs/FieldType.md b/rest/api/v3/mc_custom_fields/docs/FieldType.md new file mode 100644 index 00000000..39cade55 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/FieldType.md @@ -0,0 +1,14 @@ +# FieldType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TEXT** | string | (value: `"Text"`) +**NUMBER** | string | (value: `"Number"`) +**DATE** | string | (value: `"Date"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/FieldType1.md b/rest/api/v3/mc_custom_fields/docs/FieldType1.md new file mode 100644 index 00000000..0d96119b --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/FieldType1.md @@ -0,0 +1,14 @@ +# FieldType1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TEXT** | string | (value: `"Text"`) +**NUMBER** | string | (value: `"Number"`) +**DATE** | string | (value: `"Date"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/FieldType2.md b/rest/api/v3/mc_custom_fields/docs/FieldType2.md new file mode 100644 index 00000000..df80145c --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/FieldType2.md @@ -0,0 +1,14 @@ +# FieldType2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TEXT** | string | (value: `"Text"`) +**NUMBER** | string | (value: `"Number"`) +**DATE** | string | (value: `"Date"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/ListFieldDefinition.md b/rest/api/v3/mc_custom_fields/docs/ListFieldDefinition.md new file mode 100644 index 00000000..19ca33a6 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/ListFieldDefinition.md @@ -0,0 +1,44 @@ +# ListFieldDefinition + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListFieldDefinition**](ListFieldDefinition.md#ListFieldDefinition) | **Get** /v3/marketing/field_definitions | Get All Field Definitions + + + +## ListFieldDefinition + +> ListFieldDefinition200Response ListFieldDefinition(ctx, ) + +Get All Field Definitions + +**This endpoint retrieves all defined Custom Fields and Reserved Fields.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListFieldDefinitionParams struct + + +### Return type + +[**ListFieldDefinition200Response**](ListFieldDefinition200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_custom_fields/docs/ListFieldDefinition200Response.md b/rest/api/v3/mc_custom_fields/docs/ListFieldDefinition200Response.md new file mode 100644 index 00000000..a3b477f4 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/ListFieldDefinition200Response.md @@ -0,0 +1,13 @@ +# ListFieldDefinition200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomFields** | [**[]CustomFieldDefinitionsResponse**](CustomFieldDefinitionsResponse.md) | | +**ReservedFields** | [**[]ReservedFieldDefinitionsResponseInner**](ReservedFieldDefinitionsResponseInner.md) | | +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/Metadata.md b/rest/api/v3/mc_custom_fields/docs/Metadata.md new file mode 100644 index 00000000..6121300c --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | |[optional] +**Self** | **string** | |[optional] +**Next** | **string** | |[optional] +**Count** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/ReservedFieldDefinitionsResponseInner.md b/rest/api/v3/mc_custom_fields/docs/ReservedFieldDefinitionsResponseInner.md new file mode 100644 index 00000000..35e65741 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/ReservedFieldDefinitionsResponseInner.md @@ -0,0 +1,13 @@ +# ReservedFieldDefinitionsResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | |[optional] +**FieldType** | [**FieldType1**](FieldType1.md) | |[optional] +**ReadOnly** | **bool** | When `true` this means API consumers are unable to set the value of this field on contacts. |[optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinition.md b/rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinition.md new file mode 100644 index 00000000..98914789 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinition.md @@ -0,0 +1,52 @@ +# UpdateFieldDefinition + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateFieldDefinition**](UpdateFieldDefinition.md#UpdateFieldDefinition) | **Patch** /v3/marketing/field_definitions/{CustomFieldId} | Update Custom Field Definition + + + +## UpdateFieldDefinition + +> CreateFieldDefinition200Response UpdateFieldDefinition(ctx, CustomFieldIdoptional) + +Update Custom Field Definition + +**This endpoint allows you to update a defined Custom Field.** Only your Custom fields can be modified; Reserved Fields cannot be updated. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CustomFieldId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateFieldDefinitionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateFieldDefinitionRequest** | [**UpdateFieldDefinitionRequest**](UpdateFieldDefinitionRequest.md) | + +### Return type + +[**CreateFieldDefinition200Response**](CreateFieldDefinition200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinitionRequest.md b/rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinitionRequest.md new file mode 100644 index 00000000..f386d9b3 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/docs/UpdateFieldDefinitionRequest.md @@ -0,0 +1,11 @@ +# UpdateFieldDefinitionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_custom_fields/model_create_field_definition_200_response.go b/rest/api/v3/mc_custom_fields/model_create_field_definition_200_response.go new file mode 100644 index 00000000..214fb310 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_create_field_definition_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateFieldDefinition200Response struct for CreateFieldDefinition200Response +type CreateFieldDefinition200Response struct { + Id string `json:"id"` + Name string `json:"name"` + FieldType FieldType2 `json:"field_type"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_custom_fields/model_create_field_definition_400_response.go b/rest/api/v3/mc_custom_fields/model_create_field_definition_400_response.go new file mode 100644 index 00000000..1ef18211 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_create_field_definition_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateFieldDefinition400Response struct for CreateFieldDefinition400Response +type CreateFieldDefinition400Response struct { + Errors []CustomFieldsError `json:"errors"` +} diff --git a/rest/api/v3/mc_custom_fields/model_create_field_definition_request.go b/rest/api/v3/mc_custom_fields/model_create_field_definition_request.go new file mode 100644 index 00000000..599343f6 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_create_field_definition_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateFieldDefinitionRequest struct for CreateFieldDefinitionRequest +type CreateFieldDefinitionRequest struct { + Name string `json:"name"` + FieldType FieldType `json:"field_type"` +} diff --git a/rest/api/v3/mc_custom_fields/model_custom_field_definitions_response.go b/rest/api/v3/mc_custom_fields/model_custom_field_definitions_response.go new file mode 100644 index 00000000..029a2c84 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_custom_field_definitions_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CustomFieldDefinitionsResponse struct for CustomFieldDefinitionsResponse +type CustomFieldDefinitionsResponse struct { + Id string `json:"id"` + Name string `json:"name"` + FieldType FieldType2 `json:"field_type"` +} diff --git a/rest/api/v3/mc_custom_fields/model_custom_fields_error.go b/rest/api/v3/mc_custom_fields/model_custom_fields_error.go new file mode 100644 index 00000000..c763d2ec --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_custom_fields_error.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CustomFieldsError struct for CustomFieldsError +type CustomFieldsError struct { + Message string `json:"message"` + Field *string `json:"field,omitempty"` + ErrorId *string `json:"error_id,omitempty"` + Parameter *string `json:"parameter,omitempty"` +} diff --git a/rest/api/v3/mc_custom_fields/model_field_type.go b/rest/api/v3/mc_custom_fields/model_field_type.go new file mode 100644 index 00000000..d667c56f --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_field_type.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// FieldType the model 'FieldType' +type FieldType string + +// List of FieldType +const ( + FIELDTYPE_TEXT FieldType = "Text" + FIELDTYPE_NUMBER FieldType = "Number" + FIELDTYPE_DATE FieldType = "Date" +) diff --git a/rest/api/v3/mc_custom_fields/model_field_type1.go b/rest/api/v3/mc_custom_fields/model_field_type1.go new file mode 100644 index 00000000..fb7ad5b7 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_field_type1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// FieldType1 the model 'FieldType1' +type FieldType1 string + +// List of FieldType1 +const ( + FIELDTYPE1_TEXT FieldType1 = "Text" + FIELDTYPE1_NUMBER FieldType1 = "Number" + FIELDTYPE1_DATE FieldType1 = "Date" +) diff --git a/rest/api/v3/mc_custom_fields/model_field_type2.go b/rest/api/v3/mc_custom_fields/model_field_type2.go new file mode 100644 index 00000000..93faa534 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_field_type2.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// FieldType2 the model 'FieldType2' +type FieldType2 string + +// List of FieldType2 +const ( + FIELDTYPE2_TEXT FieldType2 = "Text" + FIELDTYPE2_NUMBER FieldType2 = "Number" + FIELDTYPE2_DATE FieldType2 = "Date" +) diff --git a/rest/api/v3/mc_custom_fields/model_list_field_definition_200_response.go b/rest/api/v3/mc_custom_fields/model_list_field_definition_200_response.go new file mode 100644 index 00000000..11dd5c80 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_list_field_definition_200_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListFieldDefinition200Response struct for ListFieldDefinition200Response +type ListFieldDefinition200Response struct { + CustomFields []CustomFieldDefinitionsResponse `json:"custom_fields"` + ReservedFields []ReservedFieldDefinitionsResponseInner `json:"reserved_fields"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_custom_fields/model_metadata.go b/rest/api/v3/mc_custom_fields/model_metadata.go new file mode 100644 index 00000000..99bc91cc --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_metadata.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + Prev *string `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + Next *string `json:"next,omitempty"` + Count *int32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_custom_fields/model_reserved_field_definitions_response_inner.go b/rest/api/v3/mc_custom_fields/model_reserved_field_definitions_response_inner.go new file mode 100644 index 00000000..ef81cb82 --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_reserved_field_definitions_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ReservedFieldDefinitionsResponseInner struct for ReservedFieldDefinitionsResponseInner +type ReservedFieldDefinitionsResponseInner struct { + Name *string `json:"name,omitempty"` + FieldType *FieldType1 `json:"field_type,omitempty"` + // When `true` this means API consumers are unable to set the value of this field on contacts. + ReadOnly *bool `json:"read_only,omitempty"` +} diff --git a/rest/api/v3/mc_custom_fields/model_update_field_definition_request.go b/rest/api/v3/mc_custom_fields/model_update_field_definition_request.go new file mode 100644 index 00000000..1172b9ce --- /dev/null +++ b/rest/api/v3/mc_custom_fields/model_update_field_definition_request.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Custom Fields API +* The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business. With custom fields, you can also create [segments](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2/) based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need. You can also manage your Custom Fields using the SendGrid application user interface. See [**Using Custom Fields**](https://docs.sendgrid.com/ui/managing-contacts/custom-fields) for more information, including a list of Reserved Fields. You can also manage your custom fields in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/custom-fields). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateFieldDefinitionRequest struct for UpdateFieldDefinitionRequest +type UpdateFieldDefinitionRequest struct { + Name string `json:"name"` +} diff --git a/rest/api/v3/mc_designs/README.md b/rest/api/v3/mc_designs/README.md new file mode 100644 index 00000000..cfb76ce1 --- /dev/null +++ b/rest/api/v3/mc_designs/README.md @@ -0,0 +1,84 @@ +# Go API client for + +The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). + +The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. + +You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. + +The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.002686+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateDesign* | [**CreateDesign**](docs/CreateDesign.md#createdesign) | **Post** /v3/designs | Create Design +*DeleteDesign* | [**DeleteDesign**](docs/DeleteDesign.md#deletedesign) | **Delete** /v3/designs/{Id} | Delete Design +*DuplicateDesign* | [**DuplicateDesign**](docs/DuplicateDesign.md#duplicatedesign) | **Post** /v3/designs/{Id} | Duplicate Design +*DuplicatePreBuiltDesign* | [**DuplicatePreBuiltDesign**](docs/DuplicatePreBuiltDesign.md#duplicateprebuiltdesign) | **Post** /v3/designs/pre-builts/{Id} | Duplicate SendGrid Pre-built Design +*GetDesign* | [**GetDesign**](docs/GetDesign.md#getdesign) | **Get** /v3/designs/{Id} | Get Design +*GetPreBuiltDesign* | [**GetPreBuiltDesign**](docs/GetPreBuiltDesign.md#getprebuiltdesign) | **Get** /v3/designs/pre-builts/{Id} | Get SendGrid Pre-built Design +*ListDesign* | [**ListDesign**](docs/ListDesign.md#listdesign) | **Get** /v3/designs | List Designs +*ListPreBuiltDesign* | [**ListPreBuiltDesign**](docs/ListPreBuiltDesign.md#listprebuiltdesign) | **Get** /v3/designs/pre-builts | List SendGrid Pre-built Designs +*UpdateDesign* | [**UpdateDesign**](docs/UpdateDesign.md#updatedesign) | **Patch** /v3/designs/{Id} | Update Design + + +## Documentation For Models + + - [ApiError](ApiError.md) + - [ApiErrors](ApiErrors.md) + - [DesignCommonProperties](DesignCommonProperties.md) + - [DesignDuplicateInput](DesignDuplicateInput.md) + - [DesignInput](DesignInput.md) + - [DesignOutput](DesignOutput.md) + - [DesignOutputSummary](DesignOutputSummary.md) + - [Editor](Editor.md) + - [ListDesign200Response](ListDesign200Response.md) + - [Metadata](Metadata.md) + - [UpdateDesignRequest](UpdateDesignRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_designs/api_create_design.go b/rest/api/v3/mc_designs/api_create_design.go new file mode 100644 index 00000000..4d95da09 --- /dev/null +++ b/rest/api/v3/mc_designs/api_create_design.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateDesignParam struct { + // + DesignInput *DesignInput `json:"DesignInput,omitempty"` +} + +func (params *CreateDesignParam) SetDesignInput(DesignInput DesignInput) *CreateDesignParam { + params.DesignInput = &DesignInput + return params +} + +// **This endpoint allows you to create a new design**. You can add a new design by passing data, including a string of HTML email content, to `/designs`. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to [Cross-Platform Email Design](https://sendgrid.com/docs/ui/sending-email/cross-platform-html-design/). The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the [Design and Code Editor documentation](https://sendgrid.com/docs/ui/sending-email/editor/#drag--drop-markup). Because the `/designs` endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI. +func (c *ApiService) CreateDesign(params *CreateDesignParam) (interface{}, error) { + path := "/v3/designs" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DesignInput != nil { + b, err := json.Marshal(*params.DesignInput) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_delete_design.go b/rest/api/v3/mc_designs/api_delete_design.go new file mode 100644 index 00000000..3cb9db85 --- /dev/null +++ b/rest/api/v3/mc_designs/api_delete_design.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` +} + +func (params *DeleteDesignParam) SetId(Id string) *DeleteDesignParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to delete a single design**. Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action. +func (c *ApiService) DeleteDesign(params *DeleteDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_duplicate_design.go b/rest/api/v3/mc_designs/api_duplicate_design.go new file mode 100644 index 00000000..10379e3a --- /dev/null +++ b/rest/api/v3/mc_designs/api_duplicate_design.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DuplicateDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` + // + DesignDuplicateInput *DesignDuplicateInput `json:"DesignDuplicateInput,omitempty"` +} + +func (params *DuplicateDesignParam) SetId(Id string) *DuplicateDesignParam { + params.Id = &Id + return params +} +func (params *DuplicateDesignParam) SetDesignDuplicateInput(DesignDuplicateInput DesignDuplicateInput) *DuplicateDesignParam { + params.DesignDuplicateInput = &DesignDuplicateInput + return params +} + +// **This endpoint allows you to duplicate one of your existing designs**. Modifying an existing design is often the easiest way to create something new. You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found below. +func (c *ApiService) DuplicateDesign(params *DuplicateDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DesignDuplicateInput != nil { + b, err := json.Marshal(*params.DesignDuplicateInput) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiError{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_duplicate_pre_built_design.go b/rest/api/v3/mc_designs/api_duplicate_pre_built_design.go new file mode 100644 index 00000000..d4b439e4 --- /dev/null +++ b/rest/api/v3/mc_designs/api_duplicate_pre_built_design.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DuplicatePreBuiltDesignParam struct { + // The ID of the pre-built Design you want to duplicate. + Id *string `json:"id"` + // + DesignDuplicateInput *DesignDuplicateInput `json:"DesignDuplicateInput,omitempty"` +} + +func (params *DuplicatePreBuiltDesignParam) SetId(Id string) *DuplicatePreBuiltDesignParam { + params.Id = &Id + return params +} +func (params *DuplicatePreBuiltDesignParam) SetDesignDuplicateInput(DesignDuplicateInput DesignDuplicateInput) *DuplicatePreBuiltDesignParam { + params.DesignDuplicateInput = &DesignDuplicateInput + return params +} + +// **This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs**. Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the \"List SendGrid Pre-built Designs\" endpoint. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found above. +func (c *ApiService) DuplicatePreBuiltDesign(params *DuplicatePreBuiltDesignParam) (interface{}, error) { + path := "/v3/designs/pre-builts/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DesignDuplicateInput != nil { + b, err := json.Marshal(*params.DesignDuplicateInput) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_get_design.go b/rest/api/v3/mc_designs/api_get_design.go new file mode 100644 index 00000000..05438323 --- /dev/null +++ b/rest/api/v3/mc_designs/api_get_design.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` +} + +func (params *GetDesignParam) SetId(Id string) *GetDesignParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to retrieve a single design**. A GET request to `/designs/{id}` will retrieve details about a specific design in your Design Library. This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request. +func (c *ApiService) GetDesign(params *GetDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_get_pre_built_design.go b/rest/api/v3/mc_designs/api_get_pre_built_design.go new file mode 100644 index 00000000..7cee9d39 --- /dev/null +++ b/rest/api/v3/mc_designs/api_get_pre_built_design.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetPreBuiltDesignParam struct { + // The ID of the pre-built Design you want to duplicate. + Id *string `json:"id"` +} + +func (params *GetPreBuiltDesignParam) SetId(Id string) *GetPreBuiltDesignParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to retrieve a single pre-built design**. A GET request to `/designs/pre-builts/{id}` will retrieve details about a specific pre-built design. This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify. +func (c *ApiService) GetPreBuiltDesign(params *GetPreBuiltDesignParam) (interface{}, error) { + path := "/v3/designs/pre-builts/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_list_design.go b/rest/api/v3/mc_designs/api_list_design.go new file mode 100644 index 00000000..e8c93d96 --- /dev/null +++ b/rest/api/v3/mc_designs/api_list_design.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListDesignParam struct { + // number of results to return + PageSize *int32 `json:"page_size,omitempty"` + // token corresponding to a specific page of results, as provided by metadata + PageToken *string `json:"page_token,omitempty"` + // set to false to return all fields + Summary *bool `json:"summary,omitempty"` +} + +func (params *ListDesignParam) SetPageSize(PageSize int32) *ListDesignParam { + params.PageSize = &PageSize + return params +} +func (params *ListDesignParam) SetPageToken(PageToken string) *ListDesignParam { + params.PageToken = &PageToken + return params +} +func (params *ListDesignParam) SetSummary(Summary bool) *ListDesignParam { + params.Summary = &Summary + return params +} + +// **This endpoint allows you to retrieve a list of designs already stored in your Design Library**. A GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. +func (c *ApiService) ListDesign(params *ListDesignParam) (interface{}, error) { + path := "/v3/designs" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + if params != nil && params.Summary != nil { + data.Set("summary", fmt.Sprint(*params.Summary)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListDesign200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_list_pre_built_design.go b/rest/api/v3/mc_designs/api_list_pre_built_design.go new file mode 100644 index 00000000..8b80f3fa --- /dev/null +++ b/rest/api/v3/mc_designs/api_list_pre_built_design.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListPreBuiltDesignParam struct { + // number of results to return + PageSize *int32 `json:"page_size,omitempty"` + // token corresponding to a specific page of results, as provided by metadata + PageToken *string `json:"page_token,omitempty"` + // set to false to return all fields + Summary *bool `json:"summary,omitempty"` +} + +func (params *ListPreBuiltDesignParam) SetPageSize(PageSize int32) *ListPreBuiltDesignParam { + params.PageSize = &PageSize + return params +} +func (params *ListPreBuiltDesignParam) SetPageToken(PageToken string) *ListPreBuiltDesignParam { + params.PageToken = &PageToken + return params +} +func (params *ListPreBuiltDesignParam) SetSummary(Summary bool) *ListPreBuiltDesignParam { + params.Summary = &Summary + return params +} + +// **This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid**. Unlike the `/designs` endpoint where *your* designs are stored, a GET request made to `designs/pre-builts` will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify. +func (c *ApiService) ListPreBuiltDesign(params *ListPreBuiltDesignParam) (interface{}, error) { + path := "/v3/designs/pre-builts" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + if params != nil && params.Summary != nil { + data.Set("summary", fmt.Sprint(*params.Summary)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListDesign200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/api_service.go b/rest/api/v3/mc_designs/api_service.go new file mode 100644 index 00000000..d0bf8bbe --- /dev/null +++ b/rest/api/v3/mc_designs/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_designs/api_update_design.go b/rest/api/v3/mc_designs/api_update_design.go new file mode 100644 index 00000000..66cb8bae --- /dev/null +++ b/rest/api/v3/mc_designs/api_update_design.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateDesignParam struct { + // The ID of the Design you want to duplicate. + Id *string `json:"id"` + // + UpdateDesignRequest *UpdateDesignRequest `json:"UpdateDesignRequest,omitempty"` +} + +func (params *UpdateDesignParam) SetId(Id string) *UpdateDesignParam { + params.Id = &Id + return params +} +func (params *UpdateDesignParam) SetUpdateDesignRequest(UpdateDesignRequest UpdateDesignRequest) *UpdateDesignParam { + params.UpdateDesignRequest = &UpdateDesignRequest + return params +} + +// **This endpoint allows you to edit a design**. The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered. For example, updating a design's name requires that you make a PATCH request to this endpoint with data specified for the `name` field only. ``` { \"name\": \"\" } ``` +func (c *ApiService) UpdateDesign(params *UpdateDesignParam) (interface{}, error) { + path := "/v3/designs/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateDesignRequest != nil { + b, err := json.Marshal(*params.UpdateDesignRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DesignOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ApiErrors{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_designs/docs/ApiError.md b/rest/api/v3/mc_designs/docs/ApiError.md new file mode 100644 index 00000000..65ebab4d --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ApiError.md @@ -0,0 +1,13 @@ +# ApiError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**Field** | **string** | | +**ErrorId** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/ApiErrors.md b/rest/api/v3/mc_designs/docs/ApiErrors.md new file mode 100644 index 00000000..9228c171 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ApiErrors.md @@ -0,0 +1,11 @@ +# ApiErrors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ApiError**](ApiError.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/CreateDesign.md b/rest/api/v3/mc_designs/docs/CreateDesign.md new file mode 100644 index 00000000..87211de3 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/CreateDesign.md @@ -0,0 +1,48 @@ +# CreateDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateDesign**](CreateDesign.md#CreateDesign) | **Post** /v3/designs | Create Design + + + +## CreateDesign + +> DesignOutput CreateDesign(ctx, optional) + +Create Design + +**This endpoint allows you to create a new design**. You can add a new design by passing data, including a string of HTML email content, to `/designs`. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to [Cross-Platform Email Design](https://sendgrid.com/docs/ui/sending-email/cross-platform-html-design/). The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the [Design and Code Editor documentation](https://sendgrid.com/docs/ui/sending-email/editor/#drag--drop-markup). Because the `/designs` endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DesignInput** | [**DesignInput**](DesignInput.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/DeleteDesign.md b/rest/api/v3/mc_designs/docs/DeleteDesign.md new file mode 100644 index 00000000..8b46426a --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DeleteDesign.md @@ -0,0 +1,51 @@ +# DeleteDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteDesign**](DeleteDesign.md#DeleteDesign) | **Delete** /v3/designs/{Id} | Delete Design + + + +## DeleteDesign + +> map[string]interface{} DeleteDesign(ctx, Id) + +Delete Design + +**This endpoint allows you to delete a single design**. Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/DesignCommonProperties.md b/rest/api/v3/mc_designs/docs/DesignCommonProperties.md new file mode 100644 index 00000000..70dfa399 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignCommonProperties.md @@ -0,0 +1,15 @@ +# DesignCommonProperties + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**GeneratePlainContent** | **bool** | If true, plain_content is always generated from html_content. If false, plain_content is not altered. |[optional] [default to true] +**Subject** | **string** | Subject of the Design. |[optional] +**Categories** | **[]string** | The list of categories applied to the design |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/DesignDuplicateInput.md b/rest/api/v3/mc_designs/docs/DesignDuplicateInput.md new file mode 100644 index 00000000..db86680e --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignDuplicateInput.md @@ -0,0 +1,12 @@ +# DesignDuplicateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/DesignInput.md b/rest/api/v3/mc_designs/docs/DesignInput.md new file mode 100644 index 00000000..3413ae98 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignInput.md @@ -0,0 +1,14 @@ +# DesignInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**HtmlContent** | **string** | The HTML content of the Design. | +**PlainContent** | **string** | Plain text content of the Design. |[optional] [default to ""] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/DesignOutput.md b/rest/api/v3/mc_designs/docs/DesignOutput.md new file mode 100644 index 00000000..f80ba304 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignOutput.md @@ -0,0 +1,14 @@ +# DesignOutput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**HtmlContent** | **string** | The HTML content of the Design. | +**PlainContent** | **string** | Plain text content of the Design. |[optional] [default to ""] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/DesignOutputSummary.md b/rest/api/v3/mc_designs/docs/DesignOutputSummary.md new file mode 100644 index 00000000..5a0c0a76 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DesignOutputSummary.md @@ -0,0 +1,16 @@ +# DesignOutputSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID of the Design. |[optional] +**UpdatedAt** | **string** | Datetime that Design was last updated. |[optional] +**CreatedAt** | **string** | Datetime that Design was created. |[optional] +**ThumbnailUrl** | **string** | A Thumbnail preview of the template's html content. |[optional] +**Name** | **string** | The name of the new design. |[optional] [default to "Duplicate: "] +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/DuplicateDesign.md b/rest/api/v3/mc_designs/docs/DuplicateDesign.md new file mode 100644 index 00000000..2496e786 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DuplicateDesign.md @@ -0,0 +1,52 @@ +# DuplicateDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DuplicateDesign**](DuplicateDesign.md#DuplicateDesign) | **Post** /v3/designs/{Id} | Duplicate Design + + + +## DuplicateDesign + +> DesignOutput DuplicateDesign(ctx, Idoptional) + +Duplicate Design + +**This endpoint allows you to duplicate one of your existing designs**. Modifying an existing design is often the easiest way to create something new. You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found below. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a DuplicateDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DesignDuplicateInput** | [**DesignDuplicateInput**](DesignDuplicateInput.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/DuplicatePreBuiltDesign.md b/rest/api/v3/mc_designs/docs/DuplicatePreBuiltDesign.md new file mode 100644 index 00000000..9d8e805f --- /dev/null +++ b/rest/api/v3/mc_designs/docs/DuplicatePreBuiltDesign.md @@ -0,0 +1,52 @@ +# DuplicatePreBuiltDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DuplicatePreBuiltDesign**](DuplicatePreBuiltDesign.md#DuplicatePreBuiltDesign) | **Post** /v3/designs/pre-builts/{Id} | Duplicate SendGrid Pre-built Design + + + +## DuplicatePreBuiltDesign + +> DesignOutput DuplicatePreBuiltDesign(ctx, Idoptional) + +Duplicate SendGrid Pre-built Design + +**This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs**. Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the `name` field blank, your duplicate will be assigned the name of the design it was copied from with the text \"Duplicate: \" prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the \"List SendGrid Pre-built Designs\" endpoint. You can modify your duplicate’s name at the time of creation by passing an updated value to the `name` field when making the initial request. More on retrieving design IDs can be found above. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the pre-built Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a DuplicatePreBuiltDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DesignDuplicateInput** | [**DesignDuplicateInput**](DesignDuplicateInput.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/Editor.md b/rest/api/v3/mc_designs/docs/Editor.md new file mode 100644 index 00000000..9d170841 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/Editor.md @@ -0,0 +1,13 @@ +# Editor + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CODE** | string | (value: `"code"`) +**DESIGN** | string | (value: `"design"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/GetDesign.md b/rest/api/v3/mc_designs/docs/GetDesign.md new file mode 100644 index 00000000..8bd1d16c --- /dev/null +++ b/rest/api/v3/mc_designs/docs/GetDesign.md @@ -0,0 +1,51 @@ +# GetDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetDesign**](GetDesign.md#GetDesign) | **Get** /v3/designs/{Id} | Get Design + + + +## GetDesign + +> DesignOutput GetDesign(ctx, Id) + +Get Design + +**This endpoint allows you to retrieve a single design**. A GET request to `/designs/{id}` will retrieve details about a specific design in your Design Library. This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a GetDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/GetPreBuiltDesign.md b/rest/api/v3/mc_designs/docs/GetPreBuiltDesign.md new file mode 100644 index 00000000..e49acc07 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/GetPreBuiltDesign.md @@ -0,0 +1,51 @@ +# GetPreBuiltDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetPreBuiltDesign**](GetPreBuiltDesign.md#GetPreBuiltDesign) | **Get** /v3/designs/pre-builts/{Id} | Get SendGrid Pre-built Design + + + +## GetPreBuiltDesign + +> DesignOutput GetPreBuiltDesign(ctx, Id) + +Get SendGrid Pre-built Design + +**This endpoint allows you to retrieve a single pre-built design**. A GET request to `/designs/pre-builts/{id}` will retrieve details about a specific pre-built design. This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the pre-built Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a GetPreBuiltDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/ListDesign.md b/rest/api/v3/mc_designs/docs/ListDesign.md new file mode 100644 index 00000000..f1677008 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ListDesign.md @@ -0,0 +1,50 @@ +# ListDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListDesign**](ListDesign.md#ListDesign) | **Get** /v3/designs | List Designs + + + +## ListDesign + +> ListDesign200Response ListDesign(ctx, optional) + +List Designs + +**This endpoint allows you to retrieve a list of designs already stored in your Design Library**. A GET request to `/designs` will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the `/designs/pre-builts` endpoint, which is detailed below. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **int32** | number of results to return +**PageToken** | **string** | token corresponding to a specific page of results, as provided by metadata +**Summary** | **bool** | set to false to return all fields + +### Return type + +[**ListDesign200Response**](ListDesign200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/ListDesign200Response.md b/rest/api/v3/mc_designs/docs/ListDesign200Response.md new file mode 100644 index 00000000..32f31512 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ListDesign200Response.md @@ -0,0 +1,12 @@ +# ListDesign200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]DesignOutputSummary**](DesignOutputSummary.md) | |[optional] +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/ListPreBuiltDesign.md b/rest/api/v3/mc_designs/docs/ListPreBuiltDesign.md new file mode 100644 index 00000000..0b635daa --- /dev/null +++ b/rest/api/v3/mc_designs/docs/ListPreBuiltDesign.md @@ -0,0 +1,50 @@ +# ListPreBuiltDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListPreBuiltDesign**](ListPreBuiltDesign.md#ListPreBuiltDesign) | **Get** /v3/designs/pre-builts | List SendGrid Pre-built Designs + + + +## ListPreBuiltDesign + +> ListDesign200Response ListPreBuiltDesign(ctx, optional) + +List SendGrid Pre-built Designs + +**This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid**. Unlike the `/designs` endpoint where *your* designs are stored, a GET request made to `designs/pre-builts` will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library. By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the `page_size` query parameter. This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListPreBuiltDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **int32** | number of results to return +**PageToken** | **string** | token corresponding to a specific page of results, as provided by metadata +**Summary** | **bool** | set to false to return all fields + +### Return type + +[**ListDesign200Response**](ListDesign200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/Metadata.md b/rest/api/v3/mc_designs/docs/Metadata.md new file mode 100644 index 00000000..6121300c --- /dev/null +++ b/rest/api/v3/mc_designs/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | |[optional] +**Self** | **string** | |[optional] +**Next** | **string** | |[optional] +**Count** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/docs/UpdateDesign.md b/rest/api/v3/mc_designs/docs/UpdateDesign.md new file mode 100644 index 00000000..e7385735 --- /dev/null +++ b/rest/api/v3/mc_designs/docs/UpdateDesign.md @@ -0,0 +1,52 @@ +# UpdateDesign + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateDesign**](UpdateDesign.md#UpdateDesign) | **Patch** /v3/designs/{Id} | Update Design + + + +## UpdateDesign + +> DesignOutput UpdateDesign(ctx, Idoptional) + +Update Design + +**This endpoint allows you to edit a design**. The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered. For example, updating a design's name requires that you make a PATCH request to this endpoint with data specified for the `name` field only. ``` { \"name\": \"\" } ``` + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Design you want to duplicate. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateDesignParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateDesignRequest** | [**UpdateDesignRequest**](UpdateDesignRequest.md) | + +### Return type + +[**DesignOutput**](DesignOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_designs/docs/UpdateDesignRequest.md b/rest/api/v3/mc_designs/docs/UpdateDesignRequest.md new file mode 100644 index 00000000..2187c51b --- /dev/null +++ b/rest/api/v3/mc_designs/docs/UpdateDesignRequest.md @@ -0,0 +1,16 @@ +# UpdateDesignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of the Design. |[optional] [default to "My Design"] +**HtmlContent** | **string** | The HTML content of the Design. |[optional] +**PlainContent** | **string** | Plain text content of the Design. |[optional] [default to ""] +**GeneratePlainContent** | **bool** | If true, plain_content is always generated from html_content. If false, plain_content is not altered. |[optional] [default to true] +**Subject** | **string** | Subject of the Design. |[optional] +**Categories** | **[]string** | The list of categories applied to the design |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_designs/model_api_error.go b/rest/api/v3/mc_designs/model_api_error.go new file mode 100644 index 00000000..9dbc10bb --- /dev/null +++ b/rest/api/v3/mc_designs/model_api_error.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ApiError struct for ApiError +type ApiError struct { + Message string `json:"message"` + Field string `json:"field"` + ErrorId string `json:"error_id"` +} diff --git a/rest/api/v3/mc_designs/model_api_errors.go b/rest/api/v3/mc_designs/model_api_errors.go new file mode 100644 index 00000000..eedccc2a --- /dev/null +++ b/rest/api/v3/mc_designs/model_api_errors.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ApiErrors struct for ApiErrors +type ApiErrors struct { + Errors *[]ApiError `json:"errors,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_common_properties.go b/rest/api/v3/mc_designs/model_design_common_properties.go new file mode 100644 index 00000000..fc498689 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_common_properties.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignCommonProperties struct for DesignCommonProperties +type DesignCommonProperties struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // If true, plain_content is always generated from html_content. If false, plain_content is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // Subject of the Design. + Subject *string `json:"subject,omitempty"` + // The list of categories applied to the design + Categories *[]string `json:"categories,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_duplicate_input.go b/rest/api/v3/mc_designs/model_design_duplicate_input.go new file mode 100644 index 00000000..19eac8f3 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_duplicate_input.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignDuplicateInput struct for DesignDuplicateInput +type DesignDuplicateInput struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_input.go b/rest/api/v3/mc_designs/model_design_input.go new file mode 100644 index 00000000..a64b5bf3 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_input.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignInput struct for DesignInput +type DesignInput struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // The HTML content of the Design. + HtmlContent string `json:"html_content"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_output.go b/rest/api/v3/mc_designs/model_design_output.go new file mode 100644 index 00000000..3cb19435 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_output.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignOutput struct for DesignOutput +type DesignOutput struct { + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // The HTML content of the Design. + HtmlContent string `json:"html_content"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_design_output_summary.go b/rest/api/v3/mc_designs/model_design_output_summary.go new file mode 100644 index 00000000..00b619d3 --- /dev/null +++ b/rest/api/v3/mc_designs/model_design_output_summary.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DesignOutputSummary struct for DesignOutputSummary +type DesignOutputSummary struct { + // ID of the Design. + Id *string `json:"id,omitempty"` + // Datetime that Design was last updated. + UpdatedAt *string `json:"updated_at,omitempty"` + // Datetime that Design was created. + CreatedAt *string `json:"created_at,omitempty"` + // A Thumbnail preview of the template's html content. + ThumbnailUrl *string `json:"thumbnail_url,omitempty"` + // The name of the new design. + Name *string `json:"name,omitempty"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_editor.go b/rest/api/v3/mc_designs/model_editor.go new file mode 100644 index 00000000..b5fba7d6 --- /dev/null +++ b/rest/api/v3/mc_designs/model_editor.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Editor the model 'Editor' +type Editor string + +// List of Editor +const ( + EDITOR_CODE Editor = "code" + EDITOR_DESIGN Editor = "design" +) diff --git a/rest/api/v3/mc_designs/model_list_design_200_response.go b/rest/api/v3/mc_designs/model_list_design_200_response.go new file mode 100644 index 00000000..e2c23197 --- /dev/null +++ b/rest/api/v3/mc_designs/model_list_design_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListDesign200Response struct for ListDesign200Response +type ListDesign200Response struct { + Result *[]DesignOutputSummary `json:"result,omitempty"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_metadata.go b/rest/api/v3/mc_designs/model_metadata.go new file mode 100644 index 00000000..3d1281ea --- /dev/null +++ b/rest/api/v3/mc_designs/model_metadata.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + Prev *string `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + Next *string `json:"next,omitempty"` + Count *int32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_designs/model_update_design_request.go b/rest/api/v3/mc_designs/model_update_design_request.go new file mode 100644 index 00000000..b25a0cbe --- /dev/null +++ b/rest/api/v3/mc_designs/model_update_design_request.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Designs +* The Twilio SendGrid Designs API offers the ability to manage assets stored in the Twilio SendGrid [Design Library](https://mc.sendgrid.com/design-library/my-designs). The Design Library is a feature-rich email layout tool and media repository. You can [build designs for all your marketing email needs](https://sendgrid.com/docs/ui/sending-email/working-with-marketing-campaigns-email-designs/), including Single Sends and Automations. You can also duplicate and then modify one of the pre-built designs provided by Twilio SendGrid to get you started. The Designs API provides a REST-like interface for creating new designs, retrieving a list of existing designs, duplicating or updating a design, and deleting a design. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateDesignRequest struct for UpdateDesignRequest +type UpdateDesignRequest struct { + // Name of the Design. + Name *string `json:"name,omitempty"` + // The HTML content of the Design. + HtmlContent *string `json:"html_content,omitempty"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` + // If true, plain_content is always generated from html_content. If false, plain_content is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // Subject of the Design. + Subject *string `json:"subject,omitempty"` + // The list of categories applied to the design + Categories *[]string `json:"categories,omitempty"` +} diff --git a/rest/api/v3/mc_lists/README.md b/rest/api/v3/mc_lists/README.md new file mode 100644 index 00000000..e2aa7644 --- /dev/null +++ b/rest/api/v3/mc_lists/README.md @@ -0,0 +1,81 @@ +# Go API client for + +The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). + +You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.113131+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateMarketingList* | [**CreateMarketingList**](docs/CreateMarketingList.md#createmarketinglist) | **Post** /v3/marketing/lists | Create List +*DeleteContact* | [**DeleteContact**](docs/DeleteContact.md#deletecontact) | **Delete** /v3/marketing/lists/{Id}/contacts | Remove Contacts from a List +*DeleteMarketingList* | [**DeleteMarketingList**](docs/DeleteMarketingList.md#deletemarketinglist) | **Delete** /v3/marketing/lists/{Id} | Delete a list +*GetMarketingList* | [**GetMarketingList**](docs/GetMarketingList.md#getmarketinglist) | **Get** /v3/marketing/lists/{Id} | Get a List by ID +*ListContactCount* | [**ListContactCount**](docs/ListContactCount.md#listcontactcount) | **Get** /v3/marketing/lists/{Id}/contacts/count | Get List Contact Count +*ListMarketingList* | [**ListMarketingList**](docs/ListMarketingList.md#listmarketinglist) | **Get** /v3/marketing/lists | Get All Lists +*UpdateMarketingList* | [**UpdateMarketingList**](docs/UpdateMarketingList.md#updatemarketinglist) | **Patch** /v3/marketing/lists/{Id} | Update List + + +## Documentation For Models + + - [ContactDetails](ContactDetails.md) + - [CreateMarketingList400Response](CreateMarketingList400Response.md) + - [CreateMarketingListRequest](CreateMarketingListRequest.md) + - [DeleteContact202Response](DeleteContact202Response.md) + - [DeleteMarketingList200Response](DeleteMarketingList200Response.md) + - [DeleteMarketingList404Response](DeleteMarketingList404Response.md) + - [Error](Error.md) + - [GetMarketingList200Response](GetMarketingList200Response.md) + - [List](List.md) + - [ListContactCount200Response](ListContactCount200Response.md) + - [ListMarketingList200Response](ListMarketingList200Response.md) + - [Metadata](Metadata.md) + - [SelfMetadata](SelfMetadata.md) + - [UpdateMarketingListRequest](UpdateMarketingListRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_lists/api_create_marketing_list.go b/rest/api/v3/mc_lists/api_create_marketing_list.go new file mode 100644 index 00000000..2674f041 --- /dev/null +++ b/rest/api/v3/mc_lists/api_create_marketing_list.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateMarketingListParam struct { + // + CreateMarketingListRequest *CreateMarketingListRequest `json:"CreateMarketingListRequest,omitempty"` +} + +func (params *CreateMarketingListParam) SetCreateMarketingListRequest(CreateMarketingListRequest CreateMarketingListRequest) *CreateMarketingListParam { + params.CreateMarketingListRequest = &CreateMarketingListRequest + return params +} + +// **This endpoint creates a new contacts list.** Once you create a list, you can use the UI to [trigger an automation](https://sendgrid.com/docs/ui/sending-email/getting-started-with-automation/#create-an-automation) every time you add a new contact to the list. A link to the newly created object is in `_metadata`. +func (c *ApiService) CreateMarketingList(params *CreateMarketingListParam) (interface{}, error) { + path := "/v3/marketing/lists" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateMarketingListRequest != nil { + b, err := json.Marshal(*params.CreateMarketingListRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &List{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateMarketingList400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_lists/api_delete_contact.go b/rest/api/v3/mc_lists/api_delete_contact.go new file mode 100644 index 00000000..b7d09a8e --- /dev/null +++ b/rest/api/v3/mc_lists/api_delete_contact.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteContactParam struct { + // Comma separated list of contact IDs that you want to remove from the specified contacts list. + ContactIds *string `json:"contact_ids"` + // The ID of the list on which you want to perform the operation. + Id *string `json:"id"` +} + +func (params *DeleteContactParam) SetContactIds(ContactIds string) *DeleteContactParam { + params.ContactIds = &ContactIds + return params +} +func (params *DeleteContactParam) SetId(Id string) *DeleteContactParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to remove contacts from a given list.** The contacts will not be deleted. Only their list membership will be changed. +func (c *ApiService) DeleteContact(params *DeleteContactParam) (interface{}, error) { + path := "/v3/marketing/lists/{Id}/contacts" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.ContactIds != nil { + data.Set("contact_ids", *params.ContactIds) + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &DeleteContact202Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &Error{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_lists/api_delete_marketing_list.go b/rest/api/v3/mc_lists/api_delete_marketing_list.go new file mode 100644 index 00000000..aec93ac9 --- /dev/null +++ b/rest/api/v3/mc_lists/api_delete_marketing_list.go @@ -0,0 +1,89 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteMarketingListParam struct { + // The ID of the list on which you want to perform the operation. + Id *string `json:"id"` + // Flag indicates that all contacts on the list are also to be deleted. + DeleteContacts *bool `json:"delete_contacts,omitempty"` +} + +func (params *DeleteMarketingListParam) SetId(Id string) *DeleteMarketingListParam { + params.Id = &Id + return params +} +func (params *DeleteMarketingListParam) SetDeleteContacts(DeleteContacts bool) *DeleteMarketingListParam { + params.DeleteContacts = &DeleteContacts + return params +} + +// **This endpoint allows you to deletes a specific list.** Optionally, you can also delete contacts associated to the list. The query parameter, `delete_contacts=true`, will delete the list and start an asynchronous job to delete associated contacts. +func (c *ApiService) DeleteMarketingList(params *DeleteMarketingListParam) (interface{}, error) { + path := "/v3/marketing/lists/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.DeleteContacts != nil { + data.Set("delete_contacts", fmt.Sprint(*params.DeleteContacts)) + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &DeleteMarketingList200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 204 { + s := "" + ps := &s + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteMarketingList404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_lists/api_get_marketing_list.go b/rest/api/v3/mc_lists/api_get_marketing_list.go new file mode 100644 index 00000000..4c1b6fe6 --- /dev/null +++ b/rest/api/v3/mc_lists/api_get_marketing_list.go @@ -0,0 +1,80 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetMarketingListParam struct { + // The ID of the list on which you want to perform the operation. + Id *string `json:"id"` + // Setting this parameter to the true will cause the contact_sample to be returned + ContactSample *bool `json:"contact_sample,omitempty"` +} + +func (params *GetMarketingListParam) SetId(Id string) *GetMarketingListParam { + params.Id = &Id + return params +} +func (params *GetMarketingListParam) SetContactSample(ContactSample bool) *GetMarketingListParam { + params.ContactSample = &ContactSample + return params +} + +// **This endpoint returns data about a specific list.** Setting the optional parameter `contact_sample=true` returns the `contact_sample` in the response body. Up to 50 of the most recent contacts uploaded or attached to a list will be returned. The full contact count is also returned. +func (c *ApiService) GetMarketingList(params *GetMarketingListParam) (interface{}, error) { + path := "/v3/marketing/lists/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.ContactSample != nil { + data.Set("contact_sample", fmt.Sprint(*params.ContactSample)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetMarketingList200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &[]Error{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_lists/api_list_contact_count.go b/rest/api/v3/mc_lists/api_list_contact_count.go new file mode 100644 index 00000000..3018ad40 --- /dev/null +++ b/rest/api/v3/mc_lists/api_list_contact_count.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ListContactCountParam struct { + // + Id *string `json:"id"` +} + +func (params *ListContactCountParam) SetId(Id string) *ListContactCountParam { + params.Id = &Id + return params +} + +// **This endpoint returns the number of contacts on a specific list.** +func (c *ApiService) ListContactCount(params *ListContactCountParam) (interface{}, error) { + path := "/v3/marketing/lists/{Id}/contacts/count" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListContactCount200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_lists/api_list_marketing_list.go b/rest/api/v3/mc_lists/api_list_marketing_list.go new file mode 100644 index 00000000..c057ef8f --- /dev/null +++ b/rest/api/v3/mc_lists/api_list_marketing_list.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListMarketingListParam struct { + // Maximum number of elements to return. Defaults to 100, returns 1000 max + PageSize *float32 `json:"page_size,omitempty"` + // + PageToken *string `json:"page_token,omitempty"` +} + +func (params *ListMarketingListParam) SetPageSize(PageSize float32) *ListMarketingListParam { + params.PageSize = &PageSize + return params +} +func (params *ListMarketingListParam) SetPageToken(PageToken string) *ListMarketingListParam { + params.PageToken = &PageToken + return params +} + +// **This endpoint returns an array of all of your contact lists.** +func (c *ApiService) ListMarketingList(params *ListMarketingListParam) (interface{}, error) { + path := "/v3/marketing/lists" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListMarketingList200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_lists/api_service.go b/rest/api/v3/mc_lists/api_service.go new file mode 100644 index 00000000..f7079e91 --- /dev/null +++ b/rest/api/v3/mc_lists/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_lists/api_update_marketing_list.go b/rest/api/v3/mc_lists/api_update_marketing_list.go new file mode 100644 index 00000000..73954db0 --- /dev/null +++ b/rest/api/v3/mc_lists/api_update_marketing_list.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateMarketingListParam struct { + // The ID of the list on which you want to perform the operation. + Id *string `json:"id"` + // + UpdateMarketingListRequest *UpdateMarketingListRequest `json:"UpdateMarketingListRequest,omitempty"` +} + +func (params *UpdateMarketingListParam) SetId(Id string) *UpdateMarketingListParam { + params.Id = &Id + return params +} +func (params *UpdateMarketingListParam) SetUpdateMarketingListRequest(UpdateMarketingListRequest UpdateMarketingListRequest) *UpdateMarketingListParam { + params.UpdateMarketingListRequest = &UpdateMarketingListRequest + return params +} + +// **This endpoint updates the name of a list.** +func (c *ApiService) UpdateMarketingList(params *UpdateMarketingListParam) (interface{}, error) { + path := "/v3/marketing/lists/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateMarketingListRequest != nil { + b, err := json.Marshal(*params.UpdateMarketingListRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &List{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateMarketingList400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_lists/docs/ContactDetails.md b/rest/api/v3/mc_lists/docs/ContactDetails.md new file mode 100644 index 00000000..0e6d5277 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/ContactDetails.md @@ -0,0 +1,35 @@ +# ContactDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**FirstName** | **string** | |[optional] +**LastName** | **string** | |[optional] +**UniqueName** | **string** | |[optional] +**Email** | **string** | |[optional] +**PhoneNumberId** | **string** | |[optional] +**ExternalId** | **string** | |[optional] +**AnonymousId** | **string** | |[optional] +**AlternateEmails** | **[]string** | |[optional] +**AddressLine1** | **string** | |[optional] +**AddressLine2** | **string** | |[optional] +**City** | **string** | |[optional] +**StateProvinceRegion** | **string** | |[optional] +**Country** | **string** | |[optional] +**PostalCode** | **string** | |[optional] +**PhoneNumber** | **string** | |[optional] +**Whatsapp** | **string** | |[optional] +**Line** | **string** | |[optional] +**Facebook** | **string** | |[optional] +**ListIds** | **[]string** | | +**SegmentIds** | **[]string** | |[optional] +**CustomFields** | **map[string]interface{}** | |[optional] +**CreatedAt** | [**time.Time**](time.Time.md) | | +**UpdatedAt** | [**time.Time**](time.Time.md) | | +**Metadata** | [**SelfMetadata**](SelfMetadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/CreateMarketingList.md b/rest/api/v3/mc_lists/docs/CreateMarketingList.md new file mode 100644 index 00000000..e842327c --- /dev/null +++ b/rest/api/v3/mc_lists/docs/CreateMarketingList.md @@ -0,0 +1,48 @@ +# CreateMarketingList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateMarketingList**](CreateMarketingList.md#CreateMarketingList) | **Post** /v3/marketing/lists | Create List + + + +## CreateMarketingList + +> List CreateMarketingList(ctx, optional) + +Create List + +**This endpoint creates a new contacts list.** Once you create a list, you can use the UI to [trigger an automation](https://sendgrid.com/docs/ui/sending-email/getting-started-with-automation/#create-an-automation) every time you add a new contact to the list. A link to the newly created object is in `_metadata`. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateMarketingListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**CreateMarketingListRequest** | [**CreateMarketingListRequest**](CreateMarketingListRequest.md) | + +### Return type + +[**List**](List.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_lists/docs/CreateMarketingList400Response.md b/rest/api/v3/mc_lists/docs/CreateMarketingList400Response.md new file mode 100644 index 00000000..2e203967 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/CreateMarketingList400Response.md @@ -0,0 +1,11 @@ +# CreateMarketingList400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]Error**](Error.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/CreateMarketingListRequest.md b/rest/api/v3/mc_lists/docs/CreateMarketingListRequest.md new file mode 100644 index 00000000..6774aa99 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/CreateMarketingListRequest.md @@ -0,0 +1,11 @@ +# CreateMarketingListRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Your name for your list | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/DeleteContact.md b/rest/api/v3/mc_lists/docs/DeleteContact.md new file mode 100644 index 00000000..63c22e6c --- /dev/null +++ b/rest/api/v3/mc_lists/docs/DeleteContact.md @@ -0,0 +1,51 @@ +# DeleteContact + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteContact**](DeleteContact.md#DeleteContact) | **Delete** /v3/marketing/lists/{Id}/contacts | Remove Contacts from a List + + + +## DeleteContact + +> DeleteContact202Response DeleteContact(ctx, ContactIdsId) + +Remove Contacts from a List + +**This endpoint allows you to remove contacts from a given list.** The contacts will not be deleted. Only their list membership will be changed. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the list on which you want to perform the operation. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteContactParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**DeleteContact202Response**](DeleteContact202Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_lists/docs/DeleteContact202Response.md b/rest/api/v3/mc_lists/docs/DeleteContact202Response.md new file mode 100644 index 00000000..5d30a105 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/DeleteContact202Response.md @@ -0,0 +1,11 @@ +# DeleteContact202Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JobId** | **string** | job_id of the async job |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/DeleteMarketingList.md b/rest/api/v3/mc_lists/docs/DeleteMarketingList.md new file mode 100644 index 00000000..cc154218 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/DeleteMarketingList.md @@ -0,0 +1,52 @@ +# DeleteMarketingList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteMarketingList**](DeleteMarketingList.md#DeleteMarketingList) | **Delete** /v3/marketing/lists/{Id} | Delete a list + + + +## DeleteMarketingList + +> DeleteMarketingList200Response DeleteMarketingList(ctx, Idoptional) + +Delete a list + +**This endpoint allows you to deletes a specific list.** Optionally, you can also delete contacts associated to the list. The query parameter, `delete_contacts=true`, will delete the list and start an asynchronous job to delete associated contacts. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the list on which you want to perform the operation. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteMarketingListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DeleteContacts** | **bool** | Flag indicates that all contacts on the list are also to be deleted. + +### Return type + +[**DeleteMarketingList200Response**](DeleteMarketingList200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_lists/docs/DeleteMarketingList200Response.md b/rest/api/v3/mc_lists/docs/DeleteMarketingList200Response.md new file mode 100644 index 00000000..522ea6c4 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/DeleteMarketingList200Response.md @@ -0,0 +1,11 @@ +# DeleteMarketingList200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JobId** | **string** | job_id of the async job |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/DeleteMarketingList404Response.md b/rest/api/v3/mc_lists/docs/DeleteMarketingList404Response.md new file mode 100644 index 00000000..a4ca0ac5 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/DeleteMarketingList404Response.md @@ -0,0 +1,11 @@ +# DeleteMarketingList404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | **[]map[string]interface{}** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/Error.md b/rest/api/v3/mc_lists/docs/Error.md new file mode 100644 index 00000000..e8d3a6f9 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/Error.md @@ -0,0 +1,14 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**Field** | **string** | |[optional] +**ErrorId** | **string** | |[optional] +**Parameter** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/GetMarketingList.md b/rest/api/v3/mc_lists/docs/GetMarketingList.md new file mode 100644 index 00000000..31285c58 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/GetMarketingList.md @@ -0,0 +1,52 @@ +# GetMarketingList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetMarketingList**](GetMarketingList.md#GetMarketingList) | **Get** /v3/marketing/lists/{Id} | Get a List by ID + + + +## GetMarketingList + +> GetMarketingList200Response GetMarketingList(ctx, Idoptional) + +Get a List by ID + +**This endpoint returns data about a specific list.** Setting the optional parameter `contact_sample=true` returns the `contact_sample` in the response body. Up to 50 of the most recent contacts uploaded or attached to a list will be returned. The full contact count is also returned. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the list on which you want to perform the operation. + +### Other Parameters + +Other parameters are passed through a pointer to a GetMarketingListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**ContactSample** | **bool** | Setting this parameter to the true will cause the contact_sample to be returned + +### Return type + +[**GetMarketingList200Response**](GetMarketingList200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_lists/docs/GetMarketingList200Response.md b/rest/api/v3/mc_lists/docs/GetMarketingList200Response.md new file mode 100644 index 00000000..c3f85dc0 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/GetMarketingList200Response.md @@ -0,0 +1,15 @@ +# GetMarketingList200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The generated ID for your list. |[optional] +**Name** | **string** | The name you gave your list. |[optional] +**ContactCount** | **int32** | The number of contacts currently stored on the list. |[optional] +**Metadata** | [**SelfMetadata**](SelfMetadata.md) | |[optional] +**ContactSample** | [**ContactDetails**](ContactDetails.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/List.md b/rest/api/v3/mc_lists/docs/List.md new file mode 100644 index 00000000..7941f244 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/List.md @@ -0,0 +1,14 @@ +# List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The generated ID for your list. |[optional] +**Name** | **string** | The name you gave your list. |[optional] +**ContactCount** | **int32** | The number of contacts currently stored on the list. |[optional] +**Metadata** | [**SelfMetadata**](SelfMetadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/ListContactCount.md b/rest/api/v3/mc_lists/docs/ListContactCount.md new file mode 100644 index 00000000..2e65fc61 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/ListContactCount.md @@ -0,0 +1,51 @@ +# ListContactCount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListContactCount**](ListContactCount.md#ListContactCount) | **Get** /v3/marketing/lists/{Id}/contacts/count | Get List Contact Count + + + +## ListContactCount + +> ListContactCount200Response ListContactCount(ctx, Id) + +Get List Contact Count + +**This endpoint returns the number of contacts on a specific list.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a ListContactCountParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**ListContactCount200Response**](ListContactCount200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_lists/docs/ListContactCount200Response.md b/rest/api/v3/mc_lists/docs/ListContactCount200Response.md new file mode 100644 index 00000000..aebf7d3e --- /dev/null +++ b/rest/api/v3/mc_lists/docs/ListContactCount200Response.md @@ -0,0 +1,12 @@ +# ListContactCount200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContactCount** | **int32** | |[optional] +**BillableCount** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/ListMarketingList.md b/rest/api/v3/mc_lists/docs/ListMarketingList.md new file mode 100644 index 00000000..87a1ce7b --- /dev/null +++ b/rest/api/v3/mc_lists/docs/ListMarketingList.md @@ -0,0 +1,49 @@ +# ListMarketingList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListMarketingList**](ListMarketingList.md#ListMarketingList) | **Get** /v3/marketing/lists | Get All Lists + + + +## ListMarketingList + +> ListMarketingList200Response ListMarketingList(ctx, optional) + +Get All Lists + +**This endpoint returns an array of all of your contact lists.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListMarketingListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **float32** | Maximum number of elements to return. Defaults to 100, returns 1000 max +**PageToken** | **string** | + +### Return type + +[**ListMarketingList200Response**](ListMarketingList200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_lists/docs/ListMarketingList200Response.md b/rest/api/v3/mc_lists/docs/ListMarketingList200Response.md new file mode 100644 index 00000000..cfe95bb0 --- /dev/null +++ b/rest/api/v3/mc_lists/docs/ListMarketingList200Response.md @@ -0,0 +1,12 @@ +# ListMarketingList200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]List**](List.md) | |[optional] +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/Metadata.md b/rest/api/v3/mc_lists/docs/Metadata.md new file mode 100644 index 00000000..79ca153c --- /dev/null +++ b/rest/api/v3/mc_lists/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | The URL of the previous page of results. If this field isn't present, you're at the start of the list. |[optional] +**Self** | **string** | The URL of the current page of results. |[optional] +**Next** | **string** | The URL of the next page of results. If this field isn't present, you're at the end of the list. |[optional] +**Count** | **float32** | The number of items in the entire list, i.e., across all pages. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/SelfMetadata.md b/rest/api/v3/mc_lists/docs/SelfMetadata.md new file mode 100644 index 00000000..f5efa07a --- /dev/null +++ b/rest/api/v3/mc_lists/docs/SelfMetadata.md @@ -0,0 +1,11 @@ +# SelfMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Self** | **string** | A link to this object. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/docs/UpdateMarketingList.md b/rest/api/v3/mc_lists/docs/UpdateMarketingList.md new file mode 100644 index 00000000..ed8e57ef --- /dev/null +++ b/rest/api/v3/mc_lists/docs/UpdateMarketingList.md @@ -0,0 +1,52 @@ +# UpdateMarketingList + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateMarketingList**](UpdateMarketingList.md#UpdateMarketingList) | **Patch** /v3/marketing/lists/{Id} | Update List + + + +## UpdateMarketingList + +> List UpdateMarketingList(ctx, Idoptional) + +Update List + +**This endpoint updates the name of a list.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the list on which you want to perform the operation. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateMarketingListParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateMarketingListRequest** | [**UpdateMarketingListRequest**](UpdateMarketingListRequest.md) | + +### Return type + +[**List**](List.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_lists/docs/UpdateMarketingListRequest.md b/rest/api/v3/mc_lists/docs/UpdateMarketingListRequest.md new file mode 100644 index 00000000..2d0bda0c --- /dev/null +++ b/rest/api/v3/mc_lists/docs/UpdateMarketingListRequest.md @@ -0,0 +1,11 @@ +# UpdateMarketingListRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Your name for your list. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_lists/model_contact_details.go b/rest/api/v3/mc_lists/model_contact_details.go new file mode 100644 index 00000000..960045e4 --- /dev/null +++ b/rest/api/v3/mc_lists/model_contact_details.go @@ -0,0 +1,47 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// ContactDetails struct for ContactDetails +type ContactDetails struct { + Id string `json:"id"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + UniqueName *string `json:"unique_name,omitempty"` + Email *string `json:"email,omitempty"` + PhoneNumberId *string `json:"phone_number_id,omitempty"` + ExternalId *string `json:"external_id,omitempty"` + AnonymousId *string `json:"anonymous_id,omitempty"` + AlternateEmails *[]string `json:"alternate_emails,omitempty"` + AddressLine1 *string `json:"address_line_1,omitempty"` + AddressLine2 *string `json:"address_line_2,omitempty"` + City *string `json:"city,omitempty"` + StateProvinceRegion *string `json:"state_province_region,omitempty"` + Country *string `json:"country,omitempty"` + PostalCode *string `json:"postal_code,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty"` + Whatsapp *string `json:"whatsapp,omitempty"` + Line *string `json:"line,omitempty"` + Facebook *string `json:"facebook,omitempty"` + ListIds []string `json:"list_ids"` + SegmentIds *[]string `json:"segment_ids,omitempty"` + CustomFields *map[string]interface{} `json:"custom_fields,omitempty"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + Metadata *SelfMetadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_create_marketing_list_400_response.go b/rest/api/v3/mc_lists/model_create_marketing_list_400_response.go new file mode 100644 index 00000000..f202e4ce --- /dev/null +++ b/rest/api/v3/mc_lists/model_create_marketing_list_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateMarketingList400Response struct for CreateMarketingList400Response +type CreateMarketingList400Response struct { + Errors *[]Error `json:"errors,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_create_marketing_list_request.go b/rest/api/v3/mc_lists/model_create_marketing_list_request.go new file mode 100644 index 00000000..45f22ed6 --- /dev/null +++ b/rest/api/v3/mc_lists/model_create_marketing_list_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateMarketingListRequest struct for CreateMarketingListRequest +type CreateMarketingListRequest struct { + // Your name for your list + Name string `json:"name"` +} diff --git a/rest/api/v3/mc_lists/model_delete_contact_202_response.go b/rest/api/v3/mc_lists/model_delete_contact_202_response.go new file mode 100644 index 00000000..079254f3 --- /dev/null +++ b/rest/api/v3/mc_lists/model_delete_contact_202_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteContact202Response The removal is accepted and processing. +type DeleteContact202Response struct { + // job_id of the async job + JobId *string `json:"job_id,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_delete_marketing_list_200_response.go b/rest/api/v3/mc_lists/model_delete_marketing_list_200_response.go new file mode 100644 index 00000000..9a1800d8 --- /dev/null +++ b/rest/api/v3/mc_lists/model_delete_marketing_list_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteMarketingList200Response The delete has been accepted and is processing. +type DeleteMarketingList200Response struct { + // job_id of the async job + JobId *string `json:"job_id,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_delete_marketing_list_404_response.go b/rest/api/v3/mc_lists/model_delete_marketing_list_404_response.go new file mode 100644 index 00000000..14fa0c4c --- /dev/null +++ b/rest/api/v3/mc_lists/model_delete_marketing_list_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteMarketingList404Response struct for DeleteMarketingList404Response +type DeleteMarketingList404Response struct { + Errors []map[string]interface{} `json:"errors"` +} diff --git a/rest/api/v3/mc_lists/model_error.go b/rest/api/v3/mc_lists/model_error.go new file mode 100644 index 00000000..60b82046 --- /dev/null +++ b/rest/api/v3/mc_lists/model_error.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Error struct for Error +type Error struct { + Message string `json:"message"` + Field *string `json:"field,omitempty"` + ErrorId *string `json:"error_id,omitempty"` + Parameter *string `json:"parameter,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_get_marketing_list_200_response.go b/rest/api/v3/mc_lists/model_get_marketing_list_200_response.go new file mode 100644 index 00000000..927ac41b --- /dev/null +++ b/rest/api/v3/mc_lists/model_get_marketing_list_200_response.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetMarketingList200Response struct for GetMarketingList200Response +type GetMarketingList200Response struct { + // The generated ID for your list. + Id *string `json:"id,omitempty"` + // The name you gave your list. + Name *string `json:"name,omitempty"` + // The number of contacts currently stored on the list. + ContactCount *int32 `json:"contact_count,omitempty"` + Metadata *SelfMetadata `json:"_metadata,omitempty"` + ContactSample *ContactDetails `json:"contact_sample,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_list.go b/rest/api/v3/mc_lists/model_list.go new file mode 100644 index 00000000..2e9d382a --- /dev/null +++ b/rest/api/v3/mc_lists/model_list.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// List struct for List +type List struct { + // The generated ID for your list. + Id *string `json:"id,omitempty"` + // The name you gave your list. + Name *string `json:"name,omitempty"` + // The number of contacts currently stored on the list. + ContactCount *int32 `json:"contact_count,omitempty"` + Metadata *SelfMetadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_list_contact_count_200_response.go b/rest/api/v3/mc_lists/model_list_contact_count_200_response.go new file mode 100644 index 00000000..bfb78493 --- /dev/null +++ b/rest/api/v3/mc_lists/model_list_contact_count_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListContactCount200Response struct for ListContactCount200Response +type ListContactCount200Response struct { + ContactCount *int32 `json:"contact_count,omitempty"` + BillableCount *int32 `json:"billable_count,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_list_marketing_list_200_response.go b/rest/api/v3/mc_lists/model_list_marketing_list_200_response.go new file mode 100644 index 00000000..6b652a9e --- /dev/null +++ b/rest/api/v3/mc_lists/model_list_marketing_list_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMarketingList200Response struct for ListMarketingList200Response +type ListMarketingList200Response struct { + Result *[]List `json:"result,omitempty"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_metadata.go b/rest/api/v3/mc_lists/model_metadata.go new file mode 100644 index 00000000..f0c64e60 --- /dev/null +++ b/rest/api/v3/mc_lists/model_metadata.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + // The URL of the previous page of results. If this field isn't present, you're at the start of the list. + Prev *string `json:"prev,omitempty"` + // The URL of the current page of results. + Self *string `json:"self,omitempty"` + // The URL of the next page of results. If this field isn't present, you're at the end of the list. + Next *string `json:"next,omitempty"` + // The number of items in the entire list, i.e., across all pages. + Count *float32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_self_metadata.go b/rest/api/v3/mc_lists/model_self_metadata.go new file mode 100644 index 00000000..9ae3c90b --- /dev/null +++ b/rest/api/v3/mc_lists/model_self_metadata.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SelfMetadata struct for SelfMetadata +type SelfMetadata struct { + // A link to this object. + Self *string `json:"self,omitempty"` +} diff --git a/rest/api/v3/mc_lists/model_update_marketing_list_request.go b/rest/api/v3/mc_lists/model_update_marketing_list_request.go new file mode 100644 index 00000000..773e8ba3 --- /dev/null +++ b/rest/api/v3/mc_lists/model_update_marketing_list_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Lists API +* The Twilio SendGrid Marketing Campaigns Lists API allows you to manage your contacts lists programmatically. Lists are static collections of Marketing Campaigns contacts. You can use this API to interact with the list objects themselves. To add contacts to a list, you must use the [Contacts API](https://docs.sendgrid.com/api-reference/contacts/). You can also manage your lists using the Contacts menu in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). For more information about lists and best practices for building them, see [**Building your Contact Lists**](https://sendgrid.com/docs/ui/managing-contacts/building-your-contact-list/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateMarketingListRequest struct for UpdateMarketingListRequest +type UpdateMarketingListRequest struct { + // Your name for your list. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mc_segments/README.md b/rest/api/v3/mc_segments/README.md new file mode 100644 index 00000000..eed4bd30 --- /dev/null +++ b/rest/api/v3/mc_segments/README.md @@ -0,0 +1,75 @@ +# Go API client for + +This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). + +To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.150414+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DeleteSegment* | [**DeleteSegment**](docs/DeleteSegment.md#deletesegment) | **Delete** /v3/marketing/segments/{SegmentId} | Delete Segment +*GetSegment* | [**GetSegment**](docs/GetSegment.md#getsegment) | **Get** /v3/marketing/segments/{SegmentId} | Get Segment by ID +*ListSegment* | [**ListSegment**](docs/ListSegment.md#listsegment) | **Get** /v3/marketing/segments | Get List of Segments + + +## Documentation For Models + + - [ContactResponse](ContactResponse.md) + - [ContactResponseCustomFields](ContactResponseCustomFields.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [FullSegment](FullSegment.md) + - [GetSegment404Response](GetSegment404Response.md) + - [GetSegment404ResponseErrorsInner](GetSegment404ResponseErrorsInner.md) + - [ListSegment200Response](ListSegment200Response.md) + - [ListSegment500Response](ListSegment500Response.md) + - [ListSegment500ResponseErrorsInner](ListSegment500ResponseErrorsInner.md) + - [SegmentSummary](SegmentSummary.md) + - [SegmentWriteV2](SegmentWriteV2.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_segments/api_delete_segment.go b/rest/api/v3/mc_segments/api_delete_segment.go new file mode 100644 index 00000000..5e82b2f1 --- /dev/null +++ b/rest/api/v3/mc_segments/api_delete_segment.go @@ -0,0 +1,101 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteSegmentParam struct { + // + SegmentId *string `json:"segment_id"` +} + +func (params *DeleteSegmentParam) SetSegmentId(SegmentId string) *DeleteSegmentParam { + params.SegmentId = &SegmentId + return params +} + +// **This endpoint allows you to delete a segment by `segment_id`.** Note that deleting a segment does not delete the contacts associated with the segment by default. Contacts associated with a deleted segment will remain in your list of all contacts and any other segments they belong to. +func (c *ApiService) DeleteSegment(params *DeleteSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", *params.SegmentId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetSegment404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSegment500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments/api_get_segment.go b/rest/api/v3/mc_segments/api_get_segment.go new file mode 100644 index 00000000..8d7fbcc3 --- /dev/null +++ b/rest/api/v3/mc_segments/api_get_segment.go @@ -0,0 +1,104 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetSegmentParam struct { + // + SegmentId *string `json:"segment_id"` + // Defaults to `false`. Set to `true` to return the parsed SQL AST as a JSON object in the field `query_json` + QueryJson *bool `json:"query_json,omitempty"` +} + +func (params *GetSegmentParam) SetSegmentId(SegmentId string) *GetSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *GetSegmentParam) SetQueryJson(QueryJson bool) *GetSegmentParam { + params.QueryJson = &QueryJson + return params +} + +// **This endpoint allows you to retrieve a single segment by ID.** +func (c *ApiService) GetSegment(params *GetSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", *params.SegmentId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.QueryJson != nil { + data.Set("query_json", fmt.Sprint(*params.QueryJson)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &FullSegment{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetSegment404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSegment500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments/api_list_segment.go b/rest/api/v3/mc_segments/api_list_segment.go new file mode 100644 index 00000000..80a58cd6 --- /dev/null +++ b/rest/api/v3/mc_segments/api_list_segment.go @@ -0,0 +1,120 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListSegmentParam struct { + // A list of segment IDs to retrieve. When this parameter is included, the `no_parent_list_ids` and `parent_list_ids` parameters are ignored and only segments with given IDs are returned. + Ids *[]string `json:"ids,omitempty"` + // A comma separated list of list ids to be used when searching for segments with the specified parent_list_id, no more than 50 is allowed + ParentListIds *string `json:"parent_list_ids,omitempty"` + // If set to `true` segments with an empty value of `parent_list_id` will be returned in the filter. If the value is not present it defaults to 'false'. + NoParentListId *bool `json:"no_parent_list_id,omitempty"` +} + +func (params *ListSegmentParam) SetIds(Ids []string) *ListSegmentParam { + params.Ids = &Ids + return params +} +func (params *ListSegmentParam) SetParentListIds(ParentListIds string) *ListSegmentParam { + params.ParentListIds = &ParentListIds + return params +} +func (params *ListSegmentParam) SetNoParentListId(NoParentListId bool) *ListSegmentParam { + params.NoParentListId = &NoParentListId + return params +} + +// **This endpoint allows you to retrieve a list of segments.** The query param `parent_list_ids` is treated as a filter. Any match will be returned. Zero matches will return a response code of 200 with an empty `results` array. `parent_list_ids` | `no_parent_list_id` | `ids` | `result` -----------------:|:--------------------:|:-------------:|:-------------: empty | false | empty | all segments values list_ids | false | empty | segments filtered by list_ids values list_ids |true | empty | segments filtered by list_ids and segments with no parent list_ids empty empty | true | empty | segments with no parent list_ids anything | anything | ids | segments with matching segment ids | +func (c *ApiService) ListSegment(params *ListSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ids != nil { + for _, item := range *params.Ids { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("ids", string(v)) + + } + } + if params != nil && params.ParentListIds != nil { + data.Set("parent_list_ids", *params.ParentListIds) + } + if params != nil && params.NoParentListId != nil { + data.Set("no_parent_list_id", fmt.Sprint(*params.NoParentListId)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListSegment200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSegment500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments/api_service.go b/rest/api/v3/mc_segments/api_service.go new file mode 100644 index 00000000..b3304ebe --- /dev/null +++ b/rest/api/v3/mc_segments/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_segments/docs/ContactResponse.md b/rest/api/v3/mc_segments/docs/ContactResponse.md new file mode 100644 index 00000000..0041ba2e --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ContactResponse.md @@ -0,0 +1,27 @@ +# ContactResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID assigned to a contact when added to the system. | +**Email** | **string** | Email of the contact. This is a reserved field. |[optional] +**PhoneNumberId** | **string** | The contact's Phone Number ID. This must be a valid phone number. |[optional] +**ExternalId** | **string** | The contact's External ID. |[optional] +**AnonymousId** | **string** | The contact's Anonymous ID. |[optional] +**AlternateEmails** | **[]string** | Alternate emails of the contact. This is a reserved field. | +**FirstName** | **string** | First name of the contact. This is a reserved field. | +**LastName** | **string** | Last name of the contact. This is a reserved field. | +**AddressLine1** | **string** | First line of address of the contact. This is a reserved field. | +**AddressLine2** | **string** | Second line of address of the contact. This is a reserved field. | +**City** | **string** | City associated with the contact. This is a reserved field. | +**StateProvinceRegion** | **string** | State associated with the contact. This is a reserved field. | +**PostalCode** | **int32** | Zipcode associated with the address of the contact. This is a reserved field. | +**Country** | **string** | Country associated with the address of the contact. This is a reserved field. | +**ListIds** | **[]string** | IDs of all lists the contact is part of |[optional] +**CustomFields** | [**ContactResponseCustomFields**](ContactResponseCustomFields.md) | | +**SegmentIds** | **[]string** | IDs of all segments the contact is part of |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/ContactResponseCustomFields.md b/rest/api/v3/mc_segments/docs/ContactResponseCustomFields.md new file mode 100644 index 00000000..0fc838a2 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ContactResponseCustomFields.md @@ -0,0 +1,12 @@ +# ContactResponseCustomFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomFieldName1** | **string** | |[optional] +**CustomFieldName2** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/DeleteSegment.md b/rest/api/v3/mc_segments/docs/DeleteSegment.md new file mode 100644 index 00000000..786d0f08 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/DeleteSegment.md @@ -0,0 +1,51 @@ +# DeleteSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSegment**](DeleteSegment.md#DeleteSegment) | **Delete** /v3/marketing/segments/{SegmentId} | Delete Segment + + + +## DeleteSegment + +> map[string]interface{} DeleteSegment(ctx, SegmentId) + +Delete Segment + +**This endpoint allows you to delete a segment by `segment_id`.** Note that deleting a segment does not delete the contacts associated with the segment by default. Contacts associated with a deleted segment will remain in your list of all contacts and any other segments they belong to. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments/docs/ErrorResponse.md b/rest/api/v3/mc_segments/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/ErrorResponseErrorsInner.md b/rest/api/v3/mc_segments/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/FullSegment.md b/rest/api/v3/mc_segments/docs/FullSegment.md new file mode 100644 index 00000000..f0eb54e4 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/FullSegment.md @@ -0,0 +1,22 @@ +# FullSegment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**ContactsCount** | **int32** | | +**CreatedAt** | [**time.Time**](time.Time.md) | ISO8601 of created timestamp | +**Name** | **string** | Name of the segment. | +**ParentListId** | **string** | The id of the list if this segment is a child of a list. This implies the query `AND CONTAINS(list_ids, ${parent_list_id})` |[optional] +**SampleUpdatedAt** | [**time.Time**](time.Time.md) | ISO8601 timestamp the sample was last updated | +**UpdatedAt** | [**time.Time**](time.Time.md) | ISO8601 timestamp the object was last updated | +**NextSampleUpdate** | **string** | ISO8601 string that is equal to `sample_updated_at` plus an internally calculated offset that depends on how often contacts enter or exit segments as the scheduled pipeline updates the samples. |[optional] +**ContactsSample** | [**[]ContactResponse**](ContactResponse.md) | | +**QueryJson** | **map[string]interface{}** | AST representation of the query DSL |[optional] +**ParentListIds** | **[]string** | The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future |[optional] +**QueryDsl** | **string** | SQL query which will filter contacts based on the conditions provided | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/GetSegment.md b/rest/api/v3/mc_segments/docs/GetSegment.md new file mode 100644 index 00000000..c735c438 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/GetSegment.md @@ -0,0 +1,52 @@ +# GetSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSegment**](GetSegment.md#GetSegment) | **Get** /v3/marketing/segments/{SegmentId} | Get Segment by ID + + + +## GetSegment + +> FullSegment GetSegment(ctx, SegmentIdoptional) + +Get Segment by ID + +**This endpoint allows you to retrieve a single segment by ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**QueryJson** | **bool** | Defaults to `false`. Set to `true` to return the parsed SQL AST as a JSON object in the field `query_json` + +### Return type + +[**FullSegment**](FullSegment.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments/docs/GetSegment404Response.md b/rest/api/v3/mc_segments/docs/GetSegment404Response.md new file mode 100644 index 00000000..1f7701d9 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/GetSegment404Response.md @@ -0,0 +1,11 @@ +# GetSegment404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]GetSegment404ResponseErrorsInner**](GetSegment404ResponseErrorsInner.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/GetSegment404ResponseErrorsInner.md b/rest/api/v3/mc_segments/docs/GetSegment404ResponseErrorsInner.md new file mode 100644 index 00000000..77220d8b --- /dev/null +++ b/rest/api/v3/mc_segments/docs/GetSegment404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# GetSegment404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**Field** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/ListSegment.md b/rest/api/v3/mc_segments/docs/ListSegment.md new file mode 100644 index 00000000..21a8bd88 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ListSegment.md @@ -0,0 +1,50 @@ +# ListSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSegment**](ListSegment.md#ListSegment) | **Get** /v3/marketing/segments | Get List of Segments + + + +## ListSegment + +> ListSegment200Response ListSegment(ctx, optional) + +Get List of Segments + +**This endpoint allows you to retrieve a list of segments.** The query param `parent_list_ids` is treated as a filter. Any match will be returned. Zero matches will return a response code of 200 with an empty `results` array. `parent_list_ids` | `no_parent_list_id` | `ids` | `result` -----------------:|:--------------------:|:-------------:|:-------------: empty | false | empty | all segments values list_ids | false | empty | segments filtered by list_ids values list_ids |true | empty | segments filtered by list_ids and segments with no parent list_ids empty empty | true | empty | segments with no parent list_ids anything | anything | ids | segments with matching segment ids | + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Ids** | **[]string** | A list of segment IDs to retrieve. When this parameter is included, the `no_parent_list_ids` and `parent_list_ids` parameters are ignored and only segments with given IDs are returned. +**ParentListIds** | **string** | A comma separated list of list ids to be used when searching for segments with the specified parent_list_id, no more than 50 is allowed +**NoParentListId** | **bool** | If set to `true` segments with an empty value of `parent_list_id` will be returned in the filter. If the value is not present it defaults to 'false'. + +### Return type + +[**ListSegment200Response**](ListSegment200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments/docs/ListSegment200Response.md b/rest/api/v3/mc_segments/docs/ListSegment200Response.md new file mode 100644 index 00000000..a943da3b --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ListSegment200Response.md @@ -0,0 +1,11 @@ +# ListSegment200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]SegmentSummary**](SegmentSummary.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/ListSegment500Response.md b/rest/api/v3/mc_segments/docs/ListSegment500Response.md new file mode 100644 index 00000000..169e9d8c --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ListSegment500Response.md @@ -0,0 +1,11 @@ +# ListSegment500Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListSegment500ResponseErrorsInner**](ListSegment500ResponseErrorsInner.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/ListSegment500ResponseErrorsInner.md b/rest/api/v3/mc_segments/docs/ListSegment500ResponseErrorsInner.md new file mode 100644 index 00000000..ecd184d9 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/ListSegment500ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# ListSegment500ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/SegmentSummary.md b/rest/api/v3/mc_segments/docs/SegmentSummary.md new file mode 100644 index 00000000..64484678 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/SegmentSummary.md @@ -0,0 +1,18 @@ +# SegmentSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**ContactsCount** | **int32** | | +**CreatedAt** | [**time.Time**](time.Time.md) | ISO8601 of created timestamp | +**Name** | **string** | |[optional] +**ParentListId** | **string** | The id of the list if this segment is a child of a list. This implies the query `AND CONTAINS(list_ids, ${parent_list_id})` |[optional] +**SampleUpdatedAt** | [**time.Time**](time.Time.md) | ISO8601 timestamp the sample was last updated | +**UpdatedAt** | [**time.Time**](time.Time.md) | ISO8601 timestamp the object was last updated | +**NextSampleUpdate** | **string** | ISO8601 string that is equal to `sample_updated_at` plus an internally calculated offset that depends on how often contacts enter or exit segments as the scheduled pipeline updates the samples. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/docs/SegmentWriteV2.md b/rest/api/v3/mc_segments/docs/SegmentWriteV2.md new file mode 100644 index 00000000..25cdc2d6 --- /dev/null +++ b/rest/api/v3/mc_segments/docs/SegmentWriteV2.md @@ -0,0 +1,13 @@ +# SegmentWriteV2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of the segment. | +**ParentListIds** | **[]string** | The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future |[optional] +**QueryDsl** | **string** | SQL query which will filter contacts based on the conditions provided | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments/model_contact_response.go b/rest/api/v3/mc_segments/model_contact_response.go new file mode 100644 index 00000000..6977993a --- /dev/null +++ b/rest/api/v3/mc_segments/model_contact_response.go @@ -0,0 +1,51 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactResponse struct for ContactResponse +type ContactResponse struct { + // ID assigned to a contact when added to the system. + Id string `json:"id"` + // Email of the contact. This is a reserved field. + Email *string `json:"email,omitempty"` + // The contact's Phone Number ID. This must be a valid phone number. + PhoneNumberId *string `json:"phone_number_id,omitempty"` + // The contact's External ID. + ExternalId *string `json:"external_id,omitempty"` + // The contact's Anonymous ID. + AnonymousId *string `json:"anonymous_id,omitempty"` + // Alternate emails of the contact. This is a reserved field. + AlternateEmails []string `json:"alternate_emails"` + // First name of the contact. This is a reserved field. + FirstName string `json:"first_name"` + // Last name of the contact. This is a reserved field. + LastName string `json:"last_name"` + // First line of address of the contact. This is a reserved field. + AddressLine1 string `json:"address_line_1"` + // Second line of address of the contact. This is a reserved field. + AddressLine2 string `json:"address_line_2"` + // City associated with the contact. This is a reserved field. + City string `json:"city"` + // State associated with the contact. This is a reserved field. + StateProvinceRegion string `json:"state_province_region"` + // Zipcode associated with the address of the contact. This is a reserved field. + PostalCode int32 `json:"postal_code"` + // Country associated with the address of the contact. This is a reserved field. + Country string `json:"country"` + // IDs of all lists the contact is part of + ListIds *[]string `json:"list_ids,omitempty"` + CustomFields ContactResponseCustomFields `json:"custom_fields"` + // IDs of all segments the contact is part of + SegmentIds *[]string `json:"segment_ids,omitempty"` +} diff --git a/rest/api/v3/mc_segments/model_contact_response_custom_fields.go b/rest/api/v3/mc_segments/model_contact_response_custom_fields.go new file mode 100644 index 00000000..2a736fc7 --- /dev/null +++ b/rest/api/v3/mc_segments/model_contact_response_custom_fields.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactResponseCustomFields The user may choose to create up to 120 custom fields or none at all. This is not a reserved field. +type ContactResponseCustomFields struct { + CustomFieldName1 *string `json:"custom_field_name1,omitempty"` + CustomFieldName2 *string `json:"custom_field_name2,omitempty"` +} diff --git a/rest/api/v3/mc_segments/model_error_response.go b/rest/api/v3/mc_segments/model_error_response.go new file mode 100644 index 00000000..e178f466 --- /dev/null +++ b/rest/api/v3/mc_segments/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/mc_segments/model_error_response_errors_inner.go b/rest/api/v3/mc_segments/model_error_response_errors_inner.go new file mode 100644 index 00000000..b41f116b --- /dev/null +++ b/rest/api/v3/mc_segments/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/mc_segments/model_full_segment.go b/rest/api/v3/mc_segments/model_full_segment.go new file mode 100644 index 00000000..f365e55c --- /dev/null +++ b/rest/api/v3/mc_segments/model_full_segment.go @@ -0,0 +1,43 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// FullSegment struct for FullSegment +type FullSegment struct { + Id string `json:"id"` + ContactsCount int32 `json:"contacts_count"` + // ISO8601 of created timestamp + CreatedAt time.Time `json:"created_at"` + // Name of the segment. + Name string `json:"name"` + // The id of the list if this segment is a child of a list. This implies the query `AND CONTAINS(list_ids, ${parent_list_id})` + ParentListId *string `json:"parent_list_id,omitempty"` + // ISO8601 timestamp the sample was last updated + SampleUpdatedAt time.Time `json:"sample_updated_at"` + // ISO8601 timestamp the object was last updated + UpdatedAt time.Time `json:"updated_at"` + // ISO8601 string that is equal to `sample_updated_at` plus an internally calculated offset that depends on how often contacts enter or exit segments as the scheduled pipeline updates the samples. + NextSampleUpdate *string `json:"next_sample_update,omitempty"` + ContactsSample []ContactResponse `json:"contacts_sample"` + // AST representation of the query DSL + QueryJson *map[string]interface{} `json:"query_json,omitempty"` + // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future + ParentListIds *[]string `json:"parent_list_ids,omitempty"` + // SQL query which will filter contacts based on the conditions provided + QueryDsl string `json:"query_dsl"` +} diff --git a/rest/api/v3/mc_segments/model_get_segment_404_response.go b/rest/api/v3/mc_segments/model_get_segment_404_response.go new file mode 100644 index 00000000..b6987ee5 --- /dev/null +++ b/rest/api/v3/mc_segments/model_get_segment_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetSegment404Response struct for GetSegment404Response +type GetSegment404Response struct { + Errors []GetSegment404ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/mc_segments/model_get_segment_404_response_errors_inner.go b/rest/api/v3/mc_segments/model_get_segment_404_response_errors_inner.go new file mode 100644 index 00000000..97445b5f --- /dev/null +++ b/rest/api/v3/mc_segments/model_get_segment_404_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetSegment404ResponseErrorsInner struct for GetSegment404ResponseErrorsInner +type GetSegment404ResponseErrorsInner struct { + Message string `json:"message"` + Field string `json:"field"` +} diff --git a/rest/api/v3/mc_segments/model_list_segment_200_response.go b/rest/api/v3/mc_segments/model_list_segment_200_response.go new file mode 100644 index 00000000..44c6533a --- /dev/null +++ b/rest/api/v3/mc_segments/model_list_segment_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSegment200Response struct for ListSegment200Response +type ListSegment200Response struct { + Results []SegmentSummary `json:"results"` +} diff --git a/rest/api/v3/mc_segments/model_list_segment_500_response.go b/rest/api/v3/mc_segments/model_list_segment_500_response.go new file mode 100644 index 00000000..38b58e34 --- /dev/null +++ b/rest/api/v3/mc_segments/model_list_segment_500_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSegment500Response struct for ListSegment500Response +type ListSegment500Response struct { + Errors []ListSegment500ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/mc_segments/model_list_segment_500_response_errors_inner.go b/rest/api/v3/mc_segments/model_list_segment_500_response_errors_inner.go new file mode 100644 index 00000000..37a40fb1 --- /dev/null +++ b/rest/api/v3/mc_segments/model_list_segment_500_response_errors_inner.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSegment500ResponseErrorsInner struct for ListSegment500ResponseErrorsInner +type ListSegment500ResponseErrorsInner struct { + Message string `json:"message"` +} diff --git a/rest/api/v3/mc_segments/model_segment_summary.go b/rest/api/v3/mc_segments/model_segment_summary.go new file mode 100644 index 00000000..c54aa9da --- /dev/null +++ b/rest/api/v3/mc_segments/model_segment_summary.go @@ -0,0 +1,35 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// SegmentSummary struct for SegmentSummary +type SegmentSummary struct { + Id string `json:"id"` + ContactsCount int32 `json:"contacts_count"` + // ISO8601 of created timestamp + CreatedAt time.Time `json:"created_at"` + Name *string `json:"name,omitempty"` + // The id of the list if this segment is a child of a list. This implies the query `AND CONTAINS(list_ids, ${parent_list_id})` + ParentListId *string `json:"parent_list_id,omitempty"` + // ISO8601 timestamp the sample was last updated + SampleUpdatedAt time.Time `json:"sample_updated_at"` + // ISO8601 timestamp the object was last updated + UpdatedAt time.Time `json:"updated_at"` + // ISO8601 string that is equal to `sample_updated_at` plus an internally calculated offset that depends on how often contacts enter or exit segments as the scheduled pipeline updates the samples. + NextSampleUpdate *string `json:"next_sample_update,omitempty"` +} diff --git a/rest/api/v3/mc_segments/model_segment_write_v2.go b/rest/api/v3/mc_segments/model_segment_write_v2.go new file mode 100644 index 00000000..04aa8f81 --- /dev/null +++ b/rest/api/v3/mc_segments/model_segment_write_v2.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments API +* This API was deprecated on December 31, 2022. Following deprecation, all segments created in the Marketing Campaigns user interface began using the [Segmentation v2 API](https://docs.sendgrid.com/api-reference/segmenting-contacts-v2). To enable manual migration and data retrieval, this API's GET and DELETE operations will remain available. The POST (create) and PATCH (update) endpoints were removed on January 31, 2023 because it is no longer possible to create new v1 segments or modify existing ones. See our [Segmentation v1 to v2 upgrade instructions](https://docs.sendgrid.com/for-developers/sending-email/getting-started-the-marketing-campaigns-v2-segmentation-api#upgrade-a-v1-segment-to-v2) to manually migrate your segments to the v2 API. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SegmentWriteV2 struct for SegmentWriteV2 +type SegmentWriteV2 struct { + // Name of the segment. + Name string `json:"name"` + // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future + ParentListIds *[]string `json:"parent_list_ids,omitempty"` + // SQL query which will filter contacts based on the conditions provided + QueryDsl string `json:"query_dsl"` +} diff --git a/rest/api/v3/mc_segments_2/README.md b/rest/api/v3/mc_segments_2/README.md new file mode 100644 index 00000000..a4abdf89 --- /dev/null +++ b/rest/api/v3/mc_segments_2/README.md @@ -0,0 +1,87 @@ +# Go API client for + +The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. + +Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. + +Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. + +Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. + +Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. + +You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.151058+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateSegment* | [**CreateSegment**](docs/CreateSegment.md#createsegment) | **Post** /v3/marketing/segments/2.0 | Create Segment +*DeleteSegment* | [**DeleteSegment**](docs/DeleteSegment.md#deletesegment) | **Delete** /v3/marketing/segments/2.0/{SegmentId} | Delete segment +*GetSegment* | [**GetSegment**](docs/GetSegment.md#getsegment) | **Get** /v3/marketing/segments/2.0/{SegmentId} | Get Segment by ID +*ListSegment* | [**ListSegment**](docs/ListSegment.md#listsegment) | **Get** /v3/marketing/segments/2.0 | Get List of Segments +*RefreshSegment* | [**RefreshSegment**](docs/RefreshSegment.md#refreshsegment) | **Post** /v3/marketing/segments/2.0/refresh/{SegmentId} | Manually refresh a segment +*UpdateSegment* | [**UpdateSegment**](docs/UpdateSegment.md#updatesegment) | **Patch** /v3/marketing/segments/2.0/{SegmentId} | Update Segment + + +## Documentation For Models + + - [AllSegments200](AllSegments200.md) + - [ContactResponse](ContactResponse.md) + - [ContactResponseCustomFields](ContactResponseCustomFields.md) + - [ErrorsSegmentV2](ErrorsSegmentV2.md) + - [ErrorsSegmentV2ErrorsInner](ErrorsSegmentV2ErrorsInner.md) + - [Metadata](Metadata.md) + - [Segment2xx](Segment2xx.md) + - [SegmentError](SegmentError.md) + - [SegmentRefresh202](SegmentRefresh202.md) + - [SegmentRefreshRequest](SegmentRefreshRequest.md) + - [SegmentStatusResponse](SegmentStatusResponse.md) + - [SegmentUpdate](SegmentUpdate.md) + - [SegmentWriteV2](SegmentWriteV2.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_segments_2/api_create_segment.go b/rest/api/v3/mc_segments_2/api_create_segment.go new file mode 100644 index 00000000..022d8b8b --- /dev/null +++ b/rest/api/v3/mc_segments_2/api_create_segment.go @@ -0,0 +1,81 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSegmentParam struct { + // + SegmentWriteV2 *SegmentWriteV2 `json:"SegmentWriteV2,omitempty"` +} + +func (params *CreateSegmentParam) SetSegmentWriteV2(SegmentWriteV2 SegmentWriteV2) *CreateSegmentParam { + params.SegmentWriteV2 = &SegmentWriteV2 + return params +} + +// Segment `name` has to be unique. A user can not create a new segment with an existing segment name. +func (c *ApiService) CreateSegment(params *CreateSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/2.0" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SegmentWriteV2 != nil { + b, err := json.Marshal(*params.SegmentWriteV2) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &Segment2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments_2/api_delete_segment.go b/rest/api/v3/mc_segments_2/api_delete_segment.go new file mode 100644 index 00000000..192318c0 --- /dev/null +++ b/rest/api/v3/mc_segments_2/api_delete_segment.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteSegmentParam struct { + // + SegmentId *string `json:"segment_id"` +} + +func (params *DeleteSegmentParam) SetSegmentId(SegmentId string) *DeleteSegmentParam { + params.SegmentId = &SegmentId + return params +} + +// **This endpoint allows you to delete a segment by ID.** +func (c *ApiService) DeleteSegment(params *DeleteSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/2.0/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", *params.SegmentId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments_2/api_get_segment.go b/rest/api/v3/mc_segments_2/api_get_segment.go new file mode 100644 index 00000000..ee17dd6c --- /dev/null +++ b/rest/api/v3/mc_segments_2/api_get_segment.go @@ -0,0 +1,88 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetSegmentParam struct { + // + SegmentId *string `json:"segment_id"` + // Defaults to `true`. Set to `false` to exclude the contacts_sample in the response. + ContactsSample *bool `json:"contacts_sample,omitempty"` +} + +func (params *GetSegmentParam) SetSegmentId(SegmentId string) *GetSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *GetSegmentParam) SetContactsSample(ContactsSample bool) *GetSegmentParam { + params.ContactsSample = &ContactsSample + return params +} + +// Get Marketing Campaigns Segment by ID +func (c *ApiService) GetSegment(params *GetSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/2.0/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", *params.SegmentId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.ContactsSample != nil { + data.Set("contacts_sample", fmt.Sprint(*params.ContactsSample)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Segment2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments_2/api_list_segment.go b/rest/api/v3/mc_segments_2/api_list_segment.go new file mode 100644 index 00000000..e20699e8 --- /dev/null +++ b/rest/api/v3/mc_segments_2/api_list_segment.go @@ -0,0 +1,104 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListSegmentParam struct { + // A list of segment IDs to retrieve. When this parameter is included, the `no_parent_list_ids` and `parent_list_ids` parameters are ignored and only segments with given IDs are returned. + Ids *[]string `json:"ids,omitempty"` + // A comma separated list up to 50 in size, to filter segments on. Only segments that have any of these list ids as the parent list will be retrieved. This is different from the parameter of the same name used when creating a segment. + ParentListIds *string `json:"parent_list_ids,omitempty"` + // If set to `true`, segments with an empty value of `parent_list_id` will be returned in the filter. If the value is not present, it defaults to 'false'. + NoParentListId *bool `json:"no_parent_list_id,omitempty"` +} + +func (params *ListSegmentParam) SetIds(Ids []string) *ListSegmentParam { + params.Ids = &Ids + return params +} +func (params *ListSegmentParam) SetParentListIds(ParentListIds string) *ListSegmentParam { + params.ParentListIds = &ParentListIds + return params +} +func (params *ListSegmentParam) SetNoParentListId(NoParentListId bool) *ListSegmentParam { + params.NoParentListId = &NoParentListId + return params +} + +// **This endpoint allows you to retrieve a list of segments.** The query param `parent_list_ids` is treated as a filter. Any match will be returned. Zero matches will return a response code of 200 with an empty `results` array. `parent_list_ids` | `no_parent_list_id` | `ids` | `result` -----------------:|:--------------------:|:-------------:|:-------------: empty | false | empty | all segments values list_ids | false | empty | segments filtered by list_ids values list_ids |true | empty | segments filtered by list_ids and segments with no parent list_ids empty empty | true | empty | segments with no parent list_ids anything | anything | ids | segments with matching segment ids | +func (c *ApiService) ListSegment(params *ListSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/2.0" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ids != nil { + for _, item := range *params.Ids { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("ids", string(v)) + + } + } + if params != nil && params.ParentListIds != nil { + data.Set("parent_list_ids", *params.ParentListIds) + } + if params != nil && params.NoParentListId != nil { + data.Set("no_parent_list_id", fmt.Sprint(*params.NoParentListId)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AllSegments200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments_2/api_refresh_segment.go b/rest/api/v3/mc_segments_2/api_refresh_segment.go new file mode 100644 index 00000000..b72b78ee --- /dev/null +++ b/rest/api/v3/mc_segments_2/api_refresh_segment.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type RefreshSegmentParam struct { + // + SegmentId *string `json:"segment_id"` + // + SegmentRefreshRequest *SegmentRefreshRequest `json:"SegmentRefreshRequest"` +} + +func (params *RefreshSegmentParam) SetSegmentId(SegmentId string) *RefreshSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *RefreshSegmentParam) SetSegmentRefreshRequest(SegmentRefreshRequest SegmentRefreshRequest) *RefreshSegmentParam { + params.SegmentRefreshRequest = &SegmentRefreshRequest + return params +} + +// Manually refresh a segment by segment ID. +func (c *ApiService) RefreshSegment(params *RefreshSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/2.0/refresh/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", *params.SegmentId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SegmentRefreshRequest != nil { + b, err := json.Marshal(*params.SegmentRefreshRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &SegmentRefresh202{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &SegmentError{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &SegmentError{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments_2/api_service.go b/rest/api/v3/mc_segments_2/api_service.go new file mode 100644 index 00000000..6eb18a06 --- /dev/null +++ b/rest/api/v3/mc_segments_2/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_segments_2/api_update_segment.go b/rest/api/v3/mc_segments_2/api_update_segment.go new file mode 100644 index 00000000..324cc4f4 --- /dev/null +++ b/rest/api/v3/mc_segments_2/api_update_segment.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSegmentParam struct { + // + SegmentId *string `json:"segment_id"` + // + SegmentUpdate *SegmentUpdate `json:"SegmentUpdate,omitempty"` +} + +func (params *UpdateSegmentParam) SetSegmentId(SegmentId string) *UpdateSegmentParam { + params.SegmentId = &SegmentId + return params +} +func (params *UpdateSegmentParam) SetSegmentUpdate(SegmentUpdate SegmentUpdate) *UpdateSegmentParam { + params.SegmentUpdate = &SegmentUpdate + return params +} + +// Segment `name` has to be unique. A user can not create a new segment with an existing segment name. +func (c *ApiService) UpdateSegment(params *UpdateSegmentParam) (interface{}, error) { + path := "/v3/marketing/segments/2.0/{SegmentId}" + if params != nil && params.SegmentId != nil { + path = strings.Replace(path, "{"+"SegmentId"+"}", *params.SegmentId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SegmentUpdate != nil { + b, err := json.Marshal(*params.SegmentUpdate) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Segment2xx{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorsSegmentV2{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_segments_2/docs/AllSegments200.md b/rest/api/v3/mc_segments_2/docs/AllSegments200.md new file mode 100644 index 00000000..c0aa6fd7 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/AllSegments200.md @@ -0,0 +1,21 @@ +# AllSegments200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID assigned to the segment when created. | +**Name** | **string** | Name of the segment. | +**ContactsCount** | **int32** | Total number of contacts present in the segment | +**CreatedAt** | **string** | ISO8601 timestamp of when the object was created | +**UpdatedAt** | **string** | ISO8601 timestamp of when the object was last updated | +**SampleUpdatedAt** | **string** | ISO8601 timestamp of when the samples were last updated | +**NextSampleUpdate** | **string** | ISO8601 timestamp of when the samples will be next updated | +**ParentListIds** | **[]string** | The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future | +**QueryVersion** | **string** | If not set, segment contains a query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2. | +**Metadata** | [**Metadata**](Metadata.md) | |[optional] +**Status** | [**SegmentStatusResponse**](SegmentStatusResponse.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/ContactResponse.md b/rest/api/v3/mc_segments_2/docs/ContactResponse.md new file mode 100644 index 00000000..0041ba2e --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/ContactResponse.md @@ -0,0 +1,27 @@ +# ContactResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID assigned to a contact when added to the system. | +**Email** | **string** | Email of the contact. This is a reserved field. |[optional] +**PhoneNumberId** | **string** | The contact's Phone Number ID. This must be a valid phone number. |[optional] +**ExternalId** | **string** | The contact's External ID. |[optional] +**AnonymousId** | **string** | The contact's Anonymous ID. |[optional] +**AlternateEmails** | **[]string** | Alternate emails of the contact. This is a reserved field. | +**FirstName** | **string** | First name of the contact. This is a reserved field. | +**LastName** | **string** | Last name of the contact. This is a reserved field. | +**AddressLine1** | **string** | First line of address of the contact. This is a reserved field. | +**AddressLine2** | **string** | Second line of address of the contact. This is a reserved field. | +**City** | **string** | City associated with the contact. This is a reserved field. | +**StateProvinceRegion** | **string** | State associated with the contact. This is a reserved field. | +**PostalCode** | **int32** | Zipcode associated with the address of the contact. This is a reserved field. | +**Country** | **string** | Country associated with the address of the contact. This is a reserved field. | +**ListIds** | **[]string** | IDs of all lists the contact is part of |[optional] +**CustomFields** | [**ContactResponseCustomFields**](ContactResponseCustomFields.md) | | +**SegmentIds** | **[]string** | IDs of all segments the contact is part of |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/ContactResponseCustomFields.md b/rest/api/v3/mc_segments_2/docs/ContactResponseCustomFields.md new file mode 100644 index 00000000..0fc838a2 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/ContactResponseCustomFields.md @@ -0,0 +1,12 @@ +# ContactResponseCustomFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomFieldName1** | **string** | |[optional] +**CustomFieldName2** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/CreateSegment.md b/rest/api/v3/mc_segments_2/docs/CreateSegment.md new file mode 100644 index 00000000..171e9d2d --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/CreateSegment.md @@ -0,0 +1,48 @@ +# CreateSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSegment**](CreateSegment.md#CreateSegment) | **Post** /v3/marketing/segments/2.0 | Create Segment + + + +## CreateSegment + +> Segment2xx CreateSegment(ctx, optional) + +Create Segment + +Segment `name` has to be unique. A user can not create a new segment with an existing segment name. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SegmentWriteV2** | [**SegmentWriteV2**](SegmentWriteV2.md) | + +### Return type + +[**Segment2xx**](Segment2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments_2/docs/DeleteSegment.md b/rest/api/v3/mc_segments_2/docs/DeleteSegment.md new file mode 100644 index 00000000..b91fd466 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/DeleteSegment.md @@ -0,0 +1,51 @@ +# DeleteSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSegment**](DeleteSegment.md#DeleteSegment) | **Delete** /v3/marketing/segments/2.0/{SegmentId} | Delete segment + + + +## DeleteSegment + +> DeleteSegment(ctx, SegmentId) + +Delete segment + +**This endpoint allows you to delete a segment by ID.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2.md b/rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2.md new file mode 100644 index 00000000..07d67bc7 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2.md @@ -0,0 +1,11 @@ +# ErrorsSegmentV2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorsSegmentV2ErrorsInner**](ErrorsSegmentV2ErrorsInner.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2ErrorsInner.md b/rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2ErrorsInner.md new file mode 100644 index 00000000..ec18b439 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/ErrorsSegmentV2ErrorsInner.md @@ -0,0 +1,12 @@ +# ErrorsSegmentV2ErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | the field in the request body that is incorrect | +**Message** | **string** | a description of what is specifically wrong with the field passed in the request | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/GetSegment.md b/rest/api/v3/mc_segments_2/docs/GetSegment.md new file mode 100644 index 00000000..57cbe39a --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/GetSegment.md @@ -0,0 +1,52 @@ +# GetSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSegment**](GetSegment.md#GetSegment) | **Get** /v3/marketing/segments/2.0/{SegmentId} | Get Segment by ID + + + +## GetSegment + +> Segment2xx GetSegment(ctx, SegmentIdoptional) + +Get Segment by ID + +Get Marketing Campaigns Segment by ID + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**ContactsSample** | **bool** | Defaults to `true`. Set to `false` to exclude the contacts_sample in the response. + +### Return type + +[**Segment2xx**](Segment2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments_2/docs/ListSegment.md b/rest/api/v3/mc_segments_2/docs/ListSegment.md new file mode 100644 index 00000000..4ea5db66 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/ListSegment.md @@ -0,0 +1,50 @@ +# ListSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSegment**](ListSegment.md#ListSegment) | **Get** /v3/marketing/segments/2.0 | Get List of Segments + + + +## ListSegment + +> AllSegments200 ListSegment(ctx, optional) + +Get List of Segments + +**This endpoint allows you to retrieve a list of segments.** The query param `parent_list_ids` is treated as a filter. Any match will be returned. Zero matches will return a response code of 200 with an empty `results` array. `parent_list_ids` | `no_parent_list_id` | `ids` | `result` -----------------:|:--------------------:|:-------------:|:-------------: empty | false | empty | all segments values list_ids | false | empty | segments filtered by list_ids values list_ids |true | empty | segments filtered by list_ids and segments with no parent list_ids empty empty | true | empty | segments with no parent list_ids anything | anything | ids | segments with matching segment ids | + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Ids** | **[]string** | A list of segment IDs to retrieve. When this parameter is included, the `no_parent_list_ids` and `parent_list_ids` parameters are ignored and only segments with given IDs are returned. +**ParentListIds** | **string** | A comma separated list up to 50 in size, to filter segments on. Only segments that have any of these list ids as the parent list will be retrieved. This is different from the parameter of the same name used when creating a segment. +**NoParentListId** | **bool** | If set to `true`, segments with an empty value of `parent_list_id` will be returned in the filter. If the value is not present, it defaults to 'false'. + +### Return type + +[**AllSegments200**](AllSegments200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments_2/docs/Metadata.md b/rest/api/v3/mc_segments_2/docs/Metadata.md new file mode 100644 index 00000000..6121300c --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | |[optional] +**Self** | **string** | |[optional] +**Next** | **string** | |[optional] +**Count** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/RefreshSegment.md b/rest/api/v3/mc_segments_2/docs/RefreshSegment.md new file mode 100644 index 00000000..d02196d2 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/RefreshSegment.md @@ -0,0 +1,51 @@ +# RefreshSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RefreshSegment**](RefreshSegment.md#RefreshSegment) | **Post** /v3/marketing/segments/2.0/refresh/{SegmentId} | Manually refresh a segment + + + +## RefreshSegment + +> SegmentRefresh202 RefreshSegment(ctx, SegmentIdSegmentRefreshRequest) + +Manually refresh a segment + +Manually refresh a segment by segment ID. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a RefreshSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SegmentRefresh202**](SegmentRefresh202.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments_2/docs/Segment2xx.md b/rest/api/v3/mc_segments_2/docs/Segment2xx.md new file mode 100644 index 00000000..7a16f7f4 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/Segment2xx.md @@ -0,0 +1,25 @@ +# Segment2xx + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID assigned to the segment when created. | +**Name** | **string** | Name of the segment. | +**QueryDsl** | **string** | SQL query which will filter contacts based on the conditions provided | +**ContactsCount** | **int32** | Total number of contacts present in the segment | +**ContactsSample** | [**[]ContactResponse**](ContactResponse.md) | A subset of all contacts that are in this segment | +**CreatedAt** | **string** | ISO8601 timestamp of when the object was created | +**UpdatedAt** | **string** | ISO8601 timestamp of when the object was last updated | +**SampleUpdatedAt** | **string** | ISO8601 timestamp of when the samples were last updated | +**NextSampleUpdate** | **string** | ISO8601 timestamp of when the samples will be next updated | +**ParentListIds** | **[]string** | The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future | +**QueryVersion** | **string** | If not set, segment contains a Query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2. | +**Status** | [**SegmentStatusResponse**](SegmentStatusResponse.md) | | +**RefreshesUsed** | **int32** | The number of times a segment has been manually refreshed since start of today in the user's timezone. |[optional] +**MaxRefreshes** | **int32** | The maximum number of manual refreshes allowed per day for this segment. Currently, only 2 are allowed. |[optional] +**LastRefreshedAt** | **string** | The ISO8601 timestamp when the segment was last refreshed in UTC time. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/SegmentError.md b/rest/api/v3/mc_segments_2/docs/SegmentError.md new file mode 100644 index 00000000..f58e9427 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/SegmentError.md @@ -0,0 +1,11 @@ +# SegmentError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | **string** | A description of the error. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/SegmentRefresh202.md b/rest/api/v3/mc_segments_2/docs/SegmentRefresh202.md new file mode 100644 index 00000000..d930c1d1 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/SegmentRefresh202.md @@ -0,0 +1,11 @@ +# SegmentRefresh202 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JobId** | **string** | The ID of the manual refresh job. Used only for internal purposes. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/SegmentRefreshRequest.md b/rest/api/v3/mc_segments_2/docs/SegmentRefreshRequest.md new file mode 100644 index 00000000..fb12c37b --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/SegmentRefreshRequest.md @@ -0,0 +1,11 @@ +# SegmentRefreshRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UserTimeZone** | **string** | The user's timezone. The timezone is used to reset the refresh count at midnight in the user's local time. Only [IANA time zone format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) is accepted. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/SegmentStatusResponse.md b/rest/api/v3/mc_segments_2/docs/SegmentStatusResponse.md new file mode 100644 index 00000000..efc40275 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/SegmentStatusResponse.md @@ -0,0 +1,12 @@ +# SegmentStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QueryValidation** | **string** | Status of query validation. PENDING, VALID, or INVALID | +**ErrorMessage** | **string** | Describes any errors that were encountered during query validation |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/SegmentUpdate.md b/rest/api/v3/mc_segments_2/docs/SegmentUpdate.md new file mode 100644 index 00000000..9ddb7bfa --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/SegmentUpdate.md @@ -0,0 +1,12 @@ +# SegmentUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of the segment. |[optional] +**QueryDsl** | **string** | SQL query which will filter contacts based on the conditions provided |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/SegmentWriteV2.md b/rest/api/v3/mc_segments_2/docs/SegmentWriteV2.md new file mode 100644 index 00000000..25cdc2d6 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/SegmentWriteV2.md @@ -0,0 +1,13 @@ +# SegmentWriteV2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of the segment. | +**ParentListIds** | **[]string** | The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future |[optional] +**QueryDsl** | **string** | SQL query which will filter contacts based on the conditions provided | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_segments_2/docs/UpdateSegment.md b/rest/api/v3/mc_segments_2/docs/UpdateSegment.md new file mode 100644 index 00000000..87669084 --- /dev/null +++ b/rest/api/v3/mc_segments_2/docs/UpdateSegment.md @@ -0,0 +1,52 @@ +# UpdateSegment + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSegment**](UpdateSegment.md#UpdateSegment) | **Patch** /v3/marketing/segments/2.0/{SegmentId} | Update Segment + + + +## UpdateSegment + +> Segment2xx UpdateSegment(ctx, SegmentIdoptional) + +Update Segment + +Segment `name` has to be unique. A user can not create a new segment with an existing segment name. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SegmentId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSegmentParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SegmentUpdate** | [**SegmentUpdate**](SegmentUpdate.md) | + +### Return type + +[**Segment2xx**](Segment2xx.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_segments_2/model_all_segments200.go b/rest/api/v3/mc_segments_2/model_all_segments200.go new file mode 100644 index 00000000..497ac8b7 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_all_segments200.go @@ -0,0 +1,38 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AllSegments200 struct for AllSegments200 +type AllSegments200 struct { + // ID assigned to the segment when created. + Id string `json:"id"` + // Name of the segment. + Name string `json:"name"` + // Total number of contacts present in the segment + ContactsCount int32 `json:"contacts_count"` + // ISO8601 timestamp of when the object was created + CreatedAt string `json:"created_at"` + // ISO8601 timestamp of when the object was last updated + UpdatedAt string `json:"updated_at"` + // ISO8601 timestamp of when the samples were last updated + SampleUpdatedAt string `json:"sample_updated_at"` + // ISO8601 timestamp of when the samples will be next updated + NextSampleUpdate string `json:"next_sample_update"` + // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future + ParentListIds []string `json:"parent_list_ids"` + // If not set, segment contains a query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2. + QueryVersion string `json:"query_version"` + Metadata *Metadata `json:"_metadata,omitempty"` + Status SegmentStatusResponse `json:"status"` +} diff --git a/rest/api/v3/mc_segments_2/model_contact_response.go b/rest/api/v3/mc_segments_2/model_contact_response.go new file mode 100644 index 00000000..5a91c038 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_contact_response.go @@ -0,0 +1,51 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactResponse struct for ContactResponse +type ContactResponse struct { + // ID assigned to a contact when added to the system. + Id string `json:"id"` + // Email of the contact. This is a reserved field. + Email *string `json:"email,omitempty"` + // The contact's Phone Number ID. This must be a valid phone number. + PhoneNumberId *string `json:"phone_number_id,omitempty"` + // The contact's External ID. + ExternalId *string `json:"external_id,omitempty"` + // The contact's Anonymous ID. + AnonymousId *string `json:"anonymous_id,omitempty"` + // Alternate emails of the contact. This is a reserved field. + AlternateEmails []string `json:"alternate_emails"` + // First name of the contact. This is a reserved field. + FirstName string `json:"first_name"` + // Last name of the contact. This is a reserved field. + LastName string `json:"last_name"` + // First line of address of the contact. This is a reserved field. + AddressLine1 string `json:"address_line_1"` + // Second line of address of the contact. This is a reserved field. + AddressLine2 string `json:"address_line_2"` + // City associated with the contact. This is a reserved field. + City string `json:"city"` + // State associated with the contact. This is a reserved field. + StateProvinceRegion string `json:"state_province_region"` + // Zipcode associated with the address of the contact. This is a reserved field. + PostalCode int32 `json:"postal_code"` + // Country associated with the address of the contact. This is a reserved field. + Country string `json:"country"` + // IDs of all lists the contact is part of + ListIds *[]string `json:"list_ids,omitempty"` + CustomFields ContactResponseCustomFields `json:"custom_fields"` + // IDs of all segments the contact is part of + SegmentIds *[]string `json:"segment_ids,omitempty"` +} diff --git a/rest/api/v3/mc_segments_2/model_contact_response_custom_fields.go b/rest/api/v3/mc_segments_2/model_contact_response_custom_fields.go new file mode 100644 index 00000000..754537d5 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_contact_response_custom_fields.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ContactResponseCustomFields The user may choose to create up to 120 custom fields or none at all. This is not a reserved field. +type ContactResponseCustomFields struct { + CustomFieldName1 *string `json:"custom_field_name1,omitempty"` + CustomFieldName2 *string `json:"custom_field_name2,omitempty"` +} diff --git a/rest/api/v3/mc_segments_2/model_errors_segment_v2.go b/rest/api/v3/mc_segments_2/model_errors_segment_v2.go new file mode 100644 index 00000000..85afe100 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_errors_segment_v2.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorsSegmentV2 If the request is incorrect, an array of errors will be returned. +type ErrorsSegmentV2 struct { + Errors []ErrorsSegmentV2ErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/mc_segments_2/model_errors_segment_v2_errors_inner.go b/rest/api/v3/mc_segments_2/model_errors_segment_v2_errors_inner.go new file mode 100644 index 00000000..26eeca07 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_errors_segment_v2_errors_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorsSegmentV2ErrorsInner struct for ErrorsSegmentV2ErrorsInner +type ErrorsSegmentV2ErrorsInner struct { + // the field in the request body that is incorrect + Field string `json:"field"` + // a description of what is specifically wrong with the field passed in the request + Message string `json:"message"` +} diff --git a/rest/api/v3/mc_segments_2/model_metadata.go b/rest/api/v3/mc_segments_2/model_metadata.go new file mode 100644 index 00000000..465ac16a --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_metadata.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + Prev *string `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + Next *string `json:"next,omitempty"` + Count *int32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_segments_2/model_segment2xx.go b/rest/api/v3/mc_segments_2/model_segment2xx.go new file mode 100644 index 00000000..0ce62a86 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_segment2xx.go @@ -0,0 +1,47 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Segment2xx struct for Segment2xx +type Segment2xx struct { + // ID assigned to the segment when created. + Id string `json:"id"` + // Name of the segment. + Name string `json:"name"` + // SQL query which will filter contacts based on the conditions provided + QueryDsl string `json:"query_dsl"` + // Total number of contacts present in the segment + ContactsCount int32 `json:"contacts_count"` + // A subset of all contacts that are in this segment + ContactsSample []ContactResponse `json:"contacts_sample"` + // ISO8601 timestamp of when the object was created + CreatedAt string `json:"created_at"` + // ISO8601 timestamp of when the object was last updated + UpdatedAt string `json:"updated_at"` + // ISO8601 timestamp of when the samples were last updated + SampleUpdatedAt string `json:"sample_updated_at"` + // ISO8601 timestamp of when the samples will be next updated + NextSampleUpdate string `json:"next_sample_update"` + // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future + ParentListIds []string `json:"parent_list_ids"` + // If not set, segment contains a Query for use with Segment v1 APIs. If set to '2', segment contains a SQL query for use in v2. + QueryVersion string `json:"query_version"` + Status SegmentStatusResponse `json:"status"` + // The number of times a segment has been manually refreshed since start of today in the user's timezone. + RefreshesUsed *int32 `json:"refreshes_used,omitempty"` + // The maximum number of manual refreshes allowed per day for this segment. Currently, only 2 are allowed. + MaxRefreshes *int32 `json:"max_refreshes,omitempty"` + // The ISO8601 timestamp when the segment was last refreshed in UTC time. + LastRefreshedAt *string `json:"last_refreshed_at,omitempty"` +} diff --git a/rest/api/v3/mc_segments_2/model_segment_error.go b/rest/api/v3/mc_segments_2/model_segment_error.go new file mode 100644 index 00000000..f08b583f --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_segment_error.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SegmentError struct for SegmentError +type SegmentError struct { + // A description of the error. + Error string `json:"error"` +} diff --git a/rest/api/v3/mc_segments_2/model_segment_refresh202.go b/rest/api/v3/mc_segments_2/model_segment_refresh202.go new file mode 100644 index 00000000..5c3e00b0 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_segment_refresh202.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SegmentRefresh202 struct for SegmentRefresh202 +type SegmentRefresh202 struct { + // The ID of the manual refresh job. Used only for internal purposes. + JobId *string `json:"job_id,omitempty"` +} diff --git a/rest/api/v3/mc_segments_2/model_segment_refresh_request.go b/rest/api/v3/mc_segments_2/model_segment_refresh_request.go new file mode 100644 index 00000000..4b509e53 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_segment_refresh_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SegmentRefreshRequest struct for SegmentRefreshRequest +type SegmentRefreshRequest struct { + // The user's timezone. The timezone is used to reset the refresh count at midnight in the user's local time. Only [IANA time zone format](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) is accepted. + UserTimeZone string `json:"user_time_zone"` +} diff --git a/rest/api/v3/mc_segments_2/model_segment_status_response.go b/rest/api/v3/mc_segments_2/model_segment_status_response.go new file mode 100644 index 00000000..2bf1bf83 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_segment_status_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SegmentStatusResponse Segment status indicates whether the segment's contacts will be updated periodically +type SegmentStatusResponse struct { + // Status of query validation. PENDING, VALID, or INVALID + QueryValidation string `json:"query_validation"` + // Describes any errors that were encountered during query validation + ErrorMessage *string `json:"error_message,omitempty"` +} diff --git a/rest/api/v3/mc_segments_2/model_segment_update.go b/rest/api/v3/mc_segments_2/model_segment_update.go new file mode 100644 index 00000000..ebfede4c --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_segment_update.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SegmentUpdate struct for SegmentUpdate +type SegmentUpdate struct { + // Name of the segment. + Name *string `json:"name,omitempty"` + // SQL query which will filter contacts based on the conditions provided + QueryDsl *string `json:"query_dsl,omitempty"` +} diff --git a/rest/api/v3/mc_segments_2/model_segment_write_v2.go b/rest/api/v3/mc_segments_2/model_segment_write_v2.go new file mode 100644 index 00000000..f0acdd74 --- /dev/null +++ b/rest/api/v3/mc_segments_2/model_segment_write_v2.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Segments 2.0 API +* The Twilio SendGrid Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID. Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes. Segments built using engagement data such as \"was sent\" or \"clicked\" will take approximately 30 minutes to begin populating. Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can also manage your Segments with the [Marketing Campaigns application user interface](https://mc.sendgrid.com/contacts). See [**Segmenting Your Contacts**](https://docs.sendgrid.com/ui/managing-contacts/segmenting-your-contacts) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SegmentWriteV2 struct for SegmentWriteV2 +type SegmentWriteV2 struct { + // Name of the segment. + Name string `json:"name"` + // The array of list ids to filter contacts on when building this segment. It allows only one such list id for now. We will support more in future + ParentListIds *[]string `json:"parent_list_ids,omitempty"` + // SQL query which will filter contacts based on the conditions provided + QueryDsl string `json:"query_dsl"` +} diff --git a/rest/api/v3/mc_senders/README.md b/rest/api/v3/mc_senders/README.md new file mode 100644 index 00000000..716cda89 --- /dev/null +++ b/rest/api/v3/mc_senders/README.md @@ -0,0 +1,74 @@ +# Go API client for + +The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.193378+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateSender* | [**CreateSender**](docs/CreateSender.md#createsender) | **Post** /v3/marketing/senders | Create a Sender +*DeleteSender* | [**DeleteSender**](docs/DeleteSender.md#deletesender) | **Delete** /v3/marketing/senders/{Id} | Delete a Sender +*GetSender* | [**GetSender**](docs/GetSender.md#getsender) | **Get** /v3/marketing/senders/{Id} | Get a specific Sender +*ListSender* | [**ListSender**](docs/ListSender.md#listsender) | **Get** /v3/marketing/senders | Get a list of all Senders +*ResetSenderVerification* | [**ResetSenderVerification**](docs/ResetSenderVerification.md#resetsenderverification) | **Post** /v3/marketing/senders/{Id}/resend_verification | Resend a Sender verification +*UpdateSender* | [**UpdateSender**](docs/UpdateSender.md#updatesender) | **Patch** /v3/marketing/senders/{Id} | Update a Sender + + +## Documentation For Models + + - [CreateSenderRequest](CreateSenderRequest.md) + - [CreateSenderRequestFrom](CreateSenderRequestFrom.md) + - [CreateSenderRequestReplyTo](CreateSenderRequestReplyTo.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [ListSender200Response](ListSender200Response.md) + - [Sender](Sender.md) + - [SenderRequest](SenderRequest.md) + - [SenderRequestFrom](SenderRequestFrom.md) + - [SenderRequestReplyTo](SenderRequestReplyTo.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_senders/api_create_sender.go b/rest/api/v3/mc_senders/api_create_sender.go new file mode 100644 index 00000000..c39979a5 --- /dev/null +++ b/rest/api/v3/mc_senders/api_create_sender.go @@ -0,0 +1,98 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSenderParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateSenderRequest *CreateSenderRequest `json:"CreateSenderRequest,omitempty"` +} + +func (params *CreateSenderParam) SetOnbehalfof(Onbehalfof string) *CreateSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateSenderParam) SetCreateSenderRequest(CreateSenderRequest CreateSenderRequest) *CreateSenderParam { + params.CreateSenderRequest = &CreateSenderRequest + return params +} + +// **This endpoint allows you to create a new Sender.** *You may create up to 100 unique Senders.* Senders are required to be verified before use. If your domain has been authenticated, a new Sender will auto verify on creation. Otherwise an email will be sent to the `from.email`. +func (c *ApiService) CreateSender(params *CreateSenderParam) (interface{}, error) { + path := "/v3/marketing/senders" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateSenderRequest != nil { + b, err := json.Marshal(*params.CreateSenderRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &Sender{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_senders/api_delete_sender.go b/rest/api/v3/mc_senders/api_delete_sender.go new file mode 100644 index 00000000..d2226a7c --- /dev/null +++ b/rest/api/v3/mc_senders/api_delete_sender.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type DeleteSenderParam struct { + // The unique identifier of the Sender. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteSenderParam) SetId(Id int32) *DeleteSenderParam { + params.Id = &Id + return params +} +func (params *DeleteSenderParam) SetOnbehalfof(Onbehalfof string) *DeleteSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete an existing Sender.** +func (c *ApiService) DeleteSender(params *DeleteSenderParam) (interface{}, error) { + path := "/v3/marketing/senders/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_senders/api_get_sender.go b/rest/api/v3/mc_senders/api_get_sender.go new file mode 100644 index 00000000..17c7ddd2 --- /dev/null +++ b/rest/api/v3/mc_senders/api_get_sender.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetSenderParam struct { + // The unique identifier of the Sender. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetSenderParam) SetId(Id int32) *GetSenderParam { + params.Id = &Id + return params +} +func (params *GetSenderParam) SetOnbehalfof(Onbehalfof string) *GetSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to get the details for a specific Sender by `id`.** +func (c *ApiService) GetSender(params *GetSenderParam) (interface{}, error) { + path := "/v3/marketing/senders/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Sender{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_senders/api_list_sender.go b/rest/api/v3/mc_senders/api_list_sender.go new file mode 100644 index 00000000..9024a22a --- /dev/null +++ b/rest/api/v3/mc_senders/api_list_sender.go @@ -0,0 +1,67 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListSenderParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListSenderParam) SetOnbehalfof(Onbehalfof string) *ListSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to get a list of all your Senders.** +func (c *ApiService) ListSender(params *ListSenderParam) (interface{}, error) { + path := "/v3/marketing/senders" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListSender200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_senders/api_reset_sender_verification.go b/rest/api/v3/mc_senders/api_reset_sender_verification.go new file mode 100644 index 00000000..270fb3e9 --- /dev/null +++ b/rest/api/v3/mc_senders/api_reset_sender_verification.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ResetSenderVerificationParam struct { + // The unique identifier of the Sender. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ResetSenderVerificationParam) SetId(Id int32) *ResetSenderVerificationParam { + params.Id = &Id + return params +} +func (params *ResetSenderVerificationParam) SetOnbehalfof(Onbehalfof string) *ResetSenderVerificationParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to resend the verification request for a specific Sender.** +func (c *ApiService) ResetSenderVerification(params *ResetSenderVerificationParam) (interface{}, error) { + path := "/v3/marketing/senders/{Id}/resend_verification" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_senders/api_service.go b/rest/api/v3/mc_senders/api_service.go new file mode 100644 index 00000000..d8fd91ab --- /dev/null +++ b/rest/api/v3/mc_senders/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_senders/api_update_sender.go b/rest/api/v3/mc_senders/api_update_sender.go new file mode 100644 index 00000000..23892f4e --- /dev/null +++ b/rest/api/v3/mc_senders/api_update_sender.go @@ -0,0 +1,110 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateSenderParam struct { + // The unique identifier of the Sender. + Id *int32 `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + SenderRequest *SenderRequest `json:"SenderRequest,omitempty"` +} + +func (params *UpdateSenderParam) SetId(Id int32) *UpdateSenderParam { + params.Id = &Id + return params +} +func (params *UpdateSenderParam) SetOnbehalfof(Onbehalfof string) *UpdateSenderParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateSenderParam) SetSenderRequest(SenderRequest SenderRequest) *UpdateSenderParam { + params.SenderRequest = &SenderRequest + return params +} + +// **This endpoint allows you to update an existing Sender.** Updates to `from.email` require re-verification. If your domain has been authenticated, a new Sender will auto verify on creation. Otherwise, an email will be sent to the `from.email`. Partial updates are allowed, but fields that are marked as \"required\" in the `POST` (create) endpoint must not be nil if that field is included in the `PATCH` request. +func (c *ApiService) UpdateSender(params *UpdateSenderParam) (interface{}, error) { + path := "/v3/marketing/senders/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", fmt.Sprint(*params.Id), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SenderRequest != nil { + b, err := json.Marshal(*params.SenderRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &Sender{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_senders/docs/CreateSender.md b/rest/api/v3/mc_senders/docs/CreateSender.md new file mode 100644 index 00000000..c1f21b0e --- /dev/null +++ b/rest/api/v3/mc_senders/docs/CreateSender.md @@ -0,0 +1,49 @@ +# CreateSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSender**](CreateSender.md#CreateSender) | **Post** /v3/marketing/senders | Create a Sender + + + +## CreateSender + +> Sender CreateSender(ctx, optional) + +Create a Sender + +**This endpoint allows you to create a new Sender.** *You may create up to 100 unique Senders.* Senders are required to be verified before use. If your domain has been authenticated, a new Sender will auto verify on creation. Otherwise an email will be sent to the `from.email`. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateSenderRequest** | [**CreateSenderRequest**](CreateSenderRequest.md) | + +### Return type + +[**Sender**](Sender.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_senders/docs/CreateSenderRequest.md b/rest/api/v3/mc_senders/docs/CreateSenderRequest.md new file mode 100644 index 00000000..1848e991 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/CreateSenderRequest.md @@ -0,0 +1,19 @@ +# CreateSenderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Nickname** | **string** | A nickname for the Sender. Not used for sending. | +**From** | [**CreateSenderRequestFrom**](CreateSenderRequestFrom.md) | | +**ReplyTo** | [**CreateSenderRequestReplyTo**](CreateSenderRequestReplyTo.md) | | +**Address** | **string** | The physical address of the Sender. | +**Address2** | **string** | Additional Sender address information. |[optional] +**City** | **string** | The city of the Sender. | +**State** | **string** | The state of the Sender. |[optional] +**Zip** | **string** | The zipcode of the Sender. |[optional] +**Country** | **string** | The country of the Sender. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/CreateSenderRequestFrom.md b/rest/api/v3/mc_senders/docs/CreateSenderRequestFrom.md new file mode 100644 index 00000000..14b6faa0 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/CreateSenderRequestFrom.md @@ -0,0 +1,12 @@ +# CreateSenderRequestFrom + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address from which your recipient will receive emails. | +**Name** | **string** | The name appended to the from email field. Typically your name or company name. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/CreateSenderRequestReplyTo.md b/rest/api/v3/mc_senders/docs/CreateSenderRequestReplyTo.md new file mode 100644 index 00000000..8f4f6e5e --- /dev/null +++ b/rest/api/v3/mc_senders/docs/CreateSenderRequestReplyTo.md @@ -0,0 +1,12 @@ +# CreateSenderRequestReplyTo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address to which your recipient will reply. | +**Name** | **string** | The name appended to the reply to email field. Typically your name or company name. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/DeleteSender.md b/rest/api/v3/mc_senders/docs/DeleteSender.md new file mode 100644 index 00000000..90499cef --- /dev/null +++ b/rest/api/v3/mc_senders/docs/DeleteSender.md @@ -0,0 +1,52 @@ +# DeleteSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSender**](DeleteSender.md#DeleteSender) | **Delete** /v3/marketing/senders/{Id} | Delete a Sender + + + +## DeleteSender + +> DeleteSender(ctx, Idoptional) + +Delete a Sender + +**This endpoint allows you to delete an existing Sender.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The unique identifier of the Sender. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_senders/docs/ErrorResponse.md b/rest/api/v3/mc_senders/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/ErrorResponseErrorsInner.md b/rest/api/v3/mc_senders/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/GetSender.md b/rest/api/v3/mc_senders/docs/GetSender.md new file mode 100644 index 00000000..27544663 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/GetSender.md @@ -0,0 +1,52 @@ +# GetSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSender**](GetSender.md#GetSender) | **Get** /v3/marketing/senders/{Id} | Get a specific Sender + + + +## GetSender + +> Sender GetSender(ctx, Idoptional) + +Get a specific Sender + +**This endpoint allows you to get the details for a specific Sender by `id`.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The unique identifier of the Sender. + +### Other Parameters + +Other parameters are passed through a pointer to a GetSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**Sender**](Sender.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_senders/docs/ListSender.md b/rest/api/v3/mc_senders/docs/ListSender.md new file mode 100644 index 00000000..0490f053 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/ListSender.md @@ -0,0 +1,48 @@ +# ListSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSender**](ListSender.md#ListSender) | **Get** /v3/marketing/senders | Get a list of all Senders + + + +## ListSender + +> ListSender200Response ListSender(ctx, optional) + +Get a list of all Senders + +**This endpoint allows you to get a list of all your Senders.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListSender200Response**](ListSender200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_senders/docs/ListSender200Response.md b/rest/api/v3/mc_senders/docs/ListSender200Response.md new file mode 100644 index 00000000..d12cf53e --- /dev/null +++ b/rest/api/v3/mc_senders/docs/ListSender200Response.md @@ -0,0 +1,11 @@ +# ListSender200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]Sender**](Sender.md) | An array of Sender objects. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/ResetSenderVerification.md b/rest/api/v3/mc_senders/docs/ResetSenderVerification.md new file mode 100644 index 00000000..2351b423 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/ResetSenderVerification.md @@ -0,0 +1,52 @@ +# ResetSenderVerification + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResetSenderVerification**](ResetSenderVerification.md#ResetSenderVerification) | **Post** /v3/marketing/senders/{Id}/resend_verification | Resend a Sender verification + + + +## ResetSenderVerification + +> ResetSenderVerification(ctx, Idoptional) + +Resend a Sender verification + +**This endpoint allows you to resend the verification request for a specific Sender.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The unique identifier of the Sender. + +### Other Parameters + +Other parameters are passed through a pointer to a ResetSenderVerificationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_senders/docs/Sender.md b/rest/api/v3/mc_senders/docs/Sender.md new file mode 100644 index 00000000..13276770 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/Sender.md @@ -0,0 +1,24 @@ +# Sender + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The unique identifier of the Sender. | +**Nickname** | **string** | A nickname for the Sender. Not used for sending. | +**From** | [**CreateSenderRequestFrom**](CreateSenderRequestFrom.md) | | +**ReplyTo** | [**CreateSenderRequestReplyTo**](CreateSenderRequestReplyTo.md) | | +**Address** | **string** | The physical address of the Sender. | +**Address2** | **string** | Additional Sender address information. |[optional] +**City** | **string** | The city of the Sender. | +**State** | **string** | The state of the Sender. |[optional] +**Zip** | **string** | The zipcode of the Sender. |[optional] +**Country** | **string** | The country of the Sender. | +**Verified** | **bool** | A boolean flag indicating whether the Sender is verified or not. Only verified Senders can be used to send email. | +**Locked** | **bool** | A boolean flag that is `true` when the Sender is associated with a campaign in Draft, Scheduled, or In Progress status. You cannot update or delete a locked Sender. | +**UpdatedAt** | **int32** | The time the Sender was last updated. | +**CreatedAt** | **int32** | The time the Sender was created. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/SenderRequest.md b/rest/api/v3/mc_senders/docs/SenderRequest.md new file mode 100644 index 00000000..8ca97438 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/SenderRequest.md @@ -0,0 +1,19 @@ +# SenderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Nickname** | **string** | A nickname for the Sender. Not used for sending. |[optional] +**From** | [**SenderRequestFrom**](SenderRequestFrom.md) | |[optional] +**ReplyTo** | [**SenderRequestReplyTo**](SenderRequestReplyTo.md) | |[optional] +**Address** | **string** | The physical address of the Sender. |[optional] +**Address2** | **string** | Additional Sender address information. |[optional] +**City** | **string** | The city of the Sender. |[optional] +**State** | **string** | The state of the Sender. |[optional] +**Zip** | **string** | The zipcode of the Sender. |[optional] +**Country** | **string** | The country of the Sender. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/SenderRequestFrom.md b/rest/api/v3/mc_senders/docs/SenderRequestFrom.md new file mode 100644 index 00000000..8db8be81 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/SenderRequestFrom.md @@ -0,0 +1,12 @@ +# SenderRequestFrom + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address from which your recipient will receive emails. |[optional] +**Name** | **string** | The name appended to the from email field. Typically your name or company name. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/SenderRequestReplyTo.md b/rest/api/v3/mc_senders/docs/SenderRequestReplyTo.md new file mode 100644 index 00000000..cfebfa3c --- /dev/null +++ b/rest/api/v3/mc_senders/docs/SenderRequestReplyTo.md @@ -0,0 +1,12 @@ +# SenderRequestReplyTo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address to which your recipient will reply. |[optional] +**Name** | **string** | The name appended to the reply to email field. Typically your name or company name. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_senders/docs/UpdateSender.md b/rest/api/v3/mc_senders/docs/UpdateSender.md new file mode 100644 index 00000000..2d71e4e0 --- /dev/null +++ b/rest/api/v3/mc_senders/docs/UpdateSender.md @@ -0,0 +1,53 @@ +# UpdateSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSender**](UpdateSender.md#UpdateSender) | **Patch** /v3/marketing/senders/{Id} | Update a Sender + + + +## UpdateSender + +> Sender UpdateSender(ctx, Idoptional) + +Update a Sender + +**This endpoint allows you to update an existing Sender.** Updates to `from.email` require re-verification. If your domain has been authenticated, a new Sender will auto verify on creation. Otherwise, an email will be sent to the `from.email`. Partial updates are allowed, but fields that are marked as \"required\" in the `POST` (create) endpoint must not be nil if that field is included in the `PATCH` request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **int32** | The unique identifier of the Sender. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**SenderRequest** | [**SenderRequest**](SenderRequest.md) | + +### Return type + +[**Sender**](Sender.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_senders/model_create_sender_request.go b/rest/api/v3/mc_senders/model_create_sender_request.go new file mode 100644 index 00000000..5b037483 --- /dev/null +++ b/rest/api/v3/mc_senders/model_create_sender_request.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSenderRequest struct for CreateSenderRequest +type CreateSenderRequest struct { + // A nickname for the Sender. Not used for sending. + Nickname string `json:"nickname"` + From CreateSenderRequestFrom `json:"from"` + ReplyTo CreateSenderRequestReplyTo `json:"reply_to"` + // The physical address of the Sender. + Address string `json:"address"` + // Additional Sender address information. + Address2 *string `json:"address_2,omitempty"` + // The city of the Sender. + City string `json:"city"` + // The state of the Sender. + State *string `json:"state,omitempty"` + // The zipcode of the Sender. + Zip *string `json:"zip,omitempty"` + // The country of the Sender. + Country string `json:"country"` +} diff --git a/rest/api/v3/mc_senders/model_create_sender_request_from.go b/rest/api/v3/mc_senders/model_create_sender_request_from.go new file mode 100644 index 00000000..63bdb64e --- /dev/null +++ b/rest/api/v3/mc_senders/model_create_sender_request_from.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSenderRequestFrom struct for CreateSenderRequestFrom +type CreateSenderRequestFrom struct { + // The email address from which your recipient will receive emails. + Email string `json:"email"` + // The name appended to the from email field. Typically your name or company name. + Name string `json:"name"` +} diff --git a/rest/api/v3/mc_senders/model_create_sender_request_reply_to.go b/rest/api/v3/mc_senders/model_create_sender_request_reply_to.go new file mode 100644 index 00000000..82a5abef --- /dev/null +++ b/rest/api/v3/mc_senders/model_create_sender_request_reply_to.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSenderRequestReplyTo struct for CreateSenderRequestReplyTo +type CreateSenderRequestReplyTo struct { + // The email address to which your recipient will reply. + Email string `json:"email"` + // The name appended to the reply to email field. Typically your name or company name. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mc_senders/model_error_response.go b/rest/api/v3/mc_senders/model_error_response.go new file mode 100644 index 00000000..3513d637 --- /dev/null +++ b/rest/api/v3/mc_senders/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/mc_senders/model_error_response_errors_inner.go b/rest/api/v3/mc_senders/model_error_response_errors_inner.go new file mode 100644 index 00000000..43267f83 --- /dev/null +++ b/rest/api/v3/mc_senders/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/mc_senders/model_list_sender_200_response.go b/rest/api/v3/mc_senders/model_list_sender_200_response.go new file mode 100644 index 00000000..970767db --- /dev/null +++ b/rest/api/v3/mc_senders/model_list_sender_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSender200Response struct for ListSender200Response +type ListSender200Response struct { + // An array of Sender objects. + Results *[]Sender `json:"results,omitempty"` +} diff --git a/rest/api/v3/mc_senders/model_sender.go b/rest/api/v3/mc_senders/model_sender.go new file mode 100644 index 00000000..b204c704 --- /dev/null +++ b/rest/api/v3/mc_senders/model_sender.go @@ -0,0 +1,44 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Sender struct for Sender +type Sender struct { + // The unique identifier of the Sender. + Id int32 `json:"id"` + // A nickname for the Sender. Not used for sending. + Nickname string `json:"nickname"` + From CreateSenderRequestFrom `json:"from"` + ReplyTo CreateSenderRequestReplyTo `json:"reply_to"` + // The physical address of the Sender. + Address string `json:"address"` + // Additional Sender address information. + Address2 *string `json:"address_2,omitempty"` + // The city of the Sender. + City string `json:"city"` + // The state of the Sender. + State *string `json:"state,omitempty"` + // The zipcode of the Sender. + Zip *string `json:"zip,omitempty"` + // The country of the Sender. + Country string `json:"country"` + // A boolean flag indicating whether the Sender is verified or not. Only verified Senders can be used to send email. + Verified bool `json:"verified"` + // A boolean flag that is `true` when the Sender is associated with a campaign in Draft, Scheduled, or In Progress status. You cannot update or delete a locked Sender. + Locked bool `json:"locked"` + // The time the Sender was last updated. + UpdatedAt int32 `json:"updated_at"` + // The time the Sender was created. + CreatedAt int32 `json:"created_at"` +} diff --git a/rest/api/v3/mc_senders/model_sender_request.go b/rest/api/v3/mc_senders/model_sender_request.go new file mode 100644 index 00000000..88d80f3b --- /dev/null +++ b/rest/api/v3/mc_senders/model_sender_request.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SenderRequest struct for SenderRequest +type SenderRequest struct { + // A nickname for the Sender. Not used for sending. + Nickname *string `json:"nickname,omitempty"` + From *SenderRequestFrom `json:"from,omitempty"` + ReplyTo *SenderRequestReplyTo `json:"reply_to,omitempty"` + // The physical address of the Sender. + Address *string `json:"address,omitempty"` + // Additional Sender address information. + Address2 *string `json:"address_2,omitempty"` + // The city of the Sender. + City *string `json:"city,omitempty"` + // The state of the Sender. + State *string `json:"state,omitempty"` + // The zipcode of the Sender. + Zip *string `json:"zip,omitempty"` + // The country of the Sender. + Country *string `json:"country,omitempty"` +} diff --git a/rest/api/v3/mc_senders/model_sender_request_from.go b/rest/api/v3/mc_senders/model_sender_request_from.go new file mode 100644 index 00000000..618487c8 --- /dev/null +++ b/rest/api/v3/mc_senders/model_sender_request_from.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SenderRequestFrom struct for SenderRequestFrom +type SenderRequestFrom struct { + // The email address from which your recipient will receive emails. + Email *string `json:"email,omitempty"` + // The name appended to the from email field. Typically your name or company name. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mc_senders/model_sender_request_reply_to.go b/rest/api/v3/mc_senders/model_sender_request_reply_to.go new file mode 100644 index 00000000..4b79fc3b --- /dev/null +++ b/rest/api/v3/mc_senders/model_sender_request_reply_to.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Senders API +* The Twilio SendGrid Marketing Campaigns Senders API allows you to create a verified sender from which your marketing emails will be sent. To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Senders. A Sender represents your “From” email address—the address your recipients will see as the sender of your emails. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SenderRequestReplyTo struct for SenderRequestReplyTo +type SenderRequestReplyTo struct { + // The email address to which your recipient will reply. + Email *string `json:"email,omitempty"` + // The name appended to the reply to email field. Typically your name or company name. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/README.md b/rest/api/v3/mc_singlesends/README.md new file mode 100644 index 00000000..c6ab60e7 --- /dev/null +++ b/rest/api/v3/mc_singlesends/README.md @@ -0,0 +1,103 @@ +# Go API client for + +The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. + +A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. + +Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). + +The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.231486+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateSingleSend* | [**CreateSingleSend**](docs/CreateSingleSend.md#createsinglesend) | **Post** /v3/marketing/singlesends | Create Single Send +*DeleteScheduledSingleSend* | [**DeleteScheduledSingleSend**](docs/DeleteScheduledSingleSend.md#deletescheduledsinglesend) | **Delete** /v3/marketing/singlesends/{Id}/schedule | Delete Single Send Schedule +*DeleteSingleSend* | [**DeleteSingleSend**](docs/DeleteSingleSend.md#deletesinglesend) | **Delete** /v3/marketing/singlesends/{Id} | Delete Single Send by ID +*DeleteSingleSends* | [**DeleteSingleSends**](docs/DeleteSingleSends.md#deletesinglesends) | **Delete** /v3/marketing/singlesends | Bulk Delete Single Sends +*DuplicateSingleSend* | [**DuplicateSingleSend**](docs/DuplicateSingleSend.md#duplicatesinglesend) | **Post** /v3/marketing/singlesends/{Id} | Duplicate Single Send +*GetSingleSend* | [**GetSingleSend**](docs/GetSingleSend.md#getsinglesend) | **Get** /v3/marketing/singlesends/{Id} | Get Single Send by ID +*ListCategory* | [**ListCategory**](docs/ListCategory.md#listcategory) | **Get** /v3/marketing/singlesends/categories | Get All Categories +*ListSingleSend* | [**ListSingleSend**](docs/ListSingleSend.md#listsinglesend) | **Get** /v3/marketing/singlesends | Get All Single Sends +*ScheduleSingleSend* | [**ScheduleSingleSend**](docs/ScheduleSingleSend.md#schedulesinglesend) | **Put** /v3/marketing/singlesends/{Id}/schedule | Schedule Single Send +*SearchSingleSend* | [**SearchSingleSend**](docs/SearchSingleSend.md#searchsinglesend) | **Post** /v3/marketing/singlesends/search | Get Single Sends Search +*UpdateSingleSend* | [**UpdateSingleSend**](docs/UpdateSingleSend.md#updatesinglesend) | **Patch** /v3/marketing/singlesends/{Id} | Update Single Send + + +## Documentation For Models + + - [AbTestSummary](AbTestSummary.md) + - [DuplicateSingleSendRequest](DuplicateSingleSendRequest.md) + - [Editor](Editor.md) + - [Editor1](Editor1.md) + - [Items](Items.md) + - [ListCategory200Response](ListCategory200Response.md) + - [ListSingleSend200Response](ListSingleSend200Response.md) + - [ListSingleSend500Response](ListSingleSend500Response.md) + - [ListSingleSend500ResponseErrorsInner](ListSingleSend500ResponseErrorsInner.md) + - [Metadata](Metadata.md) + - [ScheduleSingleSend201Response](ScheduleSingleSend201Response.md) + - [ScheduleSingleSendRequest](ScheduleSingleSendRequest.md) + - [SinglesendRequest](SinglesendRequest.md) + - [SinglesendRequestEmailConfig](SinglesendRequestEmailConfig.md) + - [SinglesendRequestSendTo](SinglesendRequestSendTo.md) + - [SinglesendResponse](SinglesendResponse.md) + - [SinglesendResponseEmailConfig](SinglesendResponseEmailConfig.md) + - [SinglesendResponseSendTo](SinglesendResponseSendTo.md) + - [SinglesendResponseShort](SinglesendResponseShort.md) + - [SinglesendResponseWarningsInner](SinglesendResponseWarningsInner.md) + - [SinglesendSchedule](SinglesendSchedule.md) + - [SinglesendSearch](SinglesendSearch.md) + - [Status](Status.md) + - [Status1](Status1.md) + - [Status2](Status2.md) + - [Status3](Status3.md) + - [Type](Type.md) + - [WinnerCriteria](WinnerCriteria.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_singlesends/api_create_single_send.go b/rest/api/v3/mc_singlesends/api_create_single_send.go new file mode 100644 index 00000000..ef5f67fd --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_create_single_send.go @@ -0,0 +1,81 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSingleSendParam struct { + // + SinglesendRequest *SinglesendRequest `json:"SinglesendRequest,omitempty"` +} + +func (params *CreateSingleSendParam) SetSinglesendRequest(SinglesendRequest SinglesendRequest) *CreateSingleSendParam { + params.SinglesendRequest = &SinglesendRequest + return params +} + +// **This endpoint allows you to create a new Single Send.** Please note that if you are migrating from the previous version of Single Sends, you no longer need to pass a template ID with your request to this endpoint. Instead, you will pass all template data in the `email_config` object. This endpoint will create a draft of the Single Send but will not send it or schedule it to be sent. Any `send_at` property value set with this endpoint will prepopulate the Single Send's send date. However, the Single Send will remain an unscheduled draft until it's updated with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI. +func (c *ApiService) CreateSingleSend(params *CreateSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SinglesendRequest != nil { + b, err := json.Marshal(*params.SinglesendRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &SinglesendResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_delete_scheduled_single_send.go b/rest/api/v3/mc_singlesends/api_delete_scheduled_single_send.go new file mode 100644 index 00000000..01608356 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_delete_scheduled_single_send.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteScheduledSingleSendParam struct { + // + Id *string `json:"id"` +} + +func (params *DeleteScheduledSingleSendParam) SetId(Id string) *DeleteScheduledSingleSendParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to cancel a scheduled Single Send using a Single Send ID.** Making a DELETE request to this endpoint will cancel the scheduled sending of a Single Send. The request will not delete the Single Send itself. Deleting a Single Send can be done by passing a DELETE request to `/marketing/singlesends/{id}`. +func (c *ApiService) DeleteScheduledSingleSend(params *DeleteScheduledSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends/{Id}/schedule" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SinglesendSchedule{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_delete_single_send.go b/rest/api/v3/mc_singlesends/api_delete_single_send.go new file mode 100644 index 00000000..e3735759 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_delete_single_send.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteSingleSendParam struct { + // + Id *string `json:"id"` +} + +func (params *DeleteSingleSendParam) SetId(Id string) *DeleteSingleSendParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to delete one Single Send using a Single Send ID.** To first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint. Please note that a `DELETE` request is permanent, and your Single Send will not be recoverable after deletion. +func (c *ApiService) DeleteSingleSend(params *DeleteSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_delete_single_sends.go b/rest/api/v3/mc_singlesends/api_delete_single_sends.go new file mode 100644 index 00000000..d6bc40f4 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_delete_single_sends.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type DeleteSingleSendsParam struct { + // Single Send IDs to delete + Ids *[]string `json:"ids,omitempty"` +} + +func (params *DeleteSingleSendsParam) SetIds(Ids []string) *DeleteSingleSendsParam { + params.Ids = &Ids + return params +} + +// **This endpoint allows you to delete multiple Single Sends using an array of Single Sends IDs.** To first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint. Please note that a DELETE request is permanent, and your Single Sends will not be recoverable after deletion. +func (c *ApiService) DeleteSingleSends(params *DeleteSingleSendsParam) (interface{}, error) { + path := "/v3/marketing/singlesends" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ids != nil { + for _, item := range *params.Ids { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("ids", string(v)) + + } + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_duplicate_single_send.go b/rest/api/v3/mc_singlesends/api_duplicate_single_send.go new file mode 100644 index 00000000..84369624 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_duplicate_single_send.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DuplicateSingleSendParam struct { + // + Id *string `json:"id"` + // + DuplicateSingleSendRequest *DuplicateSingleSendRequest `json:"DuplicateSingleSendRequest,omitempty"` +} + +func (params *DuplicateSingleSendParam) SetId(Id string) *DuplicateSingleSendParam { + params.Id = &Id + return params +} +func (params *DuplicateSingleSendParam) SetDuplicateSingleSendRequest(DuplicateSingleSendRequest DuplicateSingleSendRequest) *DuplicateSingleSendParam { + params.DuplicateSingleSendRequest = &DuplicateSingleSendRequest + return params +} + +// **This endpoint allows you to duplicate an existing Single Send using its Single Send ID.** Duplicating a Single Send is useful when you want to create a Single Send but don't want to start from scratch. Once duplicated, you can update or edit the Single Send by making a PATCH request to the `/marketing/singlesends/{id}` endpoint. If you leave the `name` field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text “Copy of ” prepended to it. The `name` field length is limited to 100 characters, so the end of the new Single Send name, including “Copy of ”, will be trimmed if the name exceeds this limit. +func (c *ApiService) DuplicateSingleSend(params *DuplicateSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DuplicateSingleSendRequest != nil { + b, err := json.Marshal(*params.DuplicateSingleSendRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &SinglesendResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_get_single_send.go b/rest/api/v3/mc_singlesends/api_get_single_send.go new file mode 100644 index 00000000..61ed40a2 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_get_single_send.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetSingleSendParam struct { + // + Id *string `json:"id"` +} + +func (params *GetSingleSendParam) SetId(Id string) *GetSingleSendParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to retrieve details about one Single Send using a Single Send ID.** You can retrieve all of your Single Sends by making a GET request to the `/marketing/singlesends` endpoint. +func (c *ApiService) GetSingleSend(params *GetSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SinglesendResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_list_category.go b/rest/api/v3/mc_singlesends/api_list_category.go new file mode 100644 index 00000000..563d0182 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_list_category.go @@ -0,0 +1,57 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListCategoryParam struct { +} + +// **This endpoint allows you to retrieve all the categories associated with your Single Sends.** This endpoint will return your latest 1,000 categories. +func (c *ApiService) ListCategory() (interface{}, error) { + path := "/v3/marketing/singlesends/categories" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListCategory200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_list_single_send.go b/rest/api/v3/mc_singlesends/api_list_single_send.go new file mode 100644 index 00000000..5ea75202 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_list_single_send.go @@ -0,0 +1,78 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListSingleSendParam struct { + // + PageSize *int32 `json:"page_size,omitempty"` + // + PageToken *string `json:"page_token,omitempty"` +} + +func (params *ListSingleSendParam) SetPageSize(PageSize int32) *ListSingleSendParam { + params.PageSize = &PageSize + return params +} +func (params *ListSingleSendParam) SetPageToken(PageToken string) *ListSingleSendParam { + params.PageToken = &PageToken + return params +} + +// **This endpoint allows you to retrieve all your Single Sends.** Returns all of your Single Sends with condensed details about each, including the Single Sends' IDs. For more details about an individual Single Send, pass the Single Send's ID to the `/marketing/singlesends/{id}` endpoint. +func (c *ApiService) ListSingleSend(params *ListSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListSingleSend200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_schedule_single_send.go b/rest/api/v3/mc_singlesends/api_schedule_single_send.go new file mode 100644 index 00000000..dc4794fb --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_schedule_single_send.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ScheduleSingleSendParam struct { + // + Id *string `json:"id"` + // + ScheduleSingleSendRequest *ScheduleSingleSendRequest `json:"ScheduleSingleSendRequest,omitempty"` +} + +func (params *ScheduleSingleSendParam) SetId(Id string) *ScheduleSingleSendParam { + params.Id = &Id + return params +} +func (params *ScheduleSingleSendParam) SetScheduleSingleSendRequest(ScheduleSingleSendRequest ScheduleSingleSendRequest) *ScheduleSingleSendParam { + params.ScheduleSingleSendRequest = &ScheduleSingleSendRequest + return params +} + +// **This endpoint allows you to send a Single Send immediately or schedule it to be sent at a later time.** To send your message immediately, set the `send_at` property value to the string `now`. To schedule the Single Send for future delivery, set the `send_at` value to your desired send time in [ISO 8601 date time format](https://www.iso.org/iso-8601-date-and-time-format.html) (`yyyy-MM-ddTHH:mm:ssZ`). +func (c *ApiService) ScheduleSingleSend(params *ScheduleSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends/{Id}/schedule" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.ScheduleSingleSendRequest != nil { + b, err := json.Marshal(*params.ScheduleSingleSendRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ScheduleSingleSend201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_search_single_send.go b/rest/api/v3/mc_singlesends/api_search_single_send.go new file mode 100644 index 00000000..c2c142bd --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_search_single_send.go @@ -0,0 +1,92 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type SearchSingleSendParam struct { + // + PageSize *int32 `json:"page_size,omitempty"` + // + PageToken *string `json:"page_token,omitempty"` + // + SinglesendSearch *SinglesendSearch `json:"SinglesendSearch,omitempty"` +} + +func (params *SearchSingleSendParam) SetPageSize(PageSize int32) *SearchSingleSendParam { + params.PageSize = &PageSize + return params +} +func (params *SearchSingleSendParam) SetPageToken(PageToken string) *SearchSingleSendParam { + params.PageToken = &PageToken + return params +} +func (params *SearchSingleSendParam) SetSinglesendSearch(SinglesendSearch SinglesendSearch) *SearchSingleSendParam { + params.SinglesendSearch = &SinglesendSearch + return params +} + +// **This endpoint allows you to search for Single Sends based on specified criteria.** You can search for Single Sends by passing a combination of values using the `name`, `status`, and `categories` request body fields. For example, if you want to search for all Single Sends that are \"drafts\" or \"scheduled\" and also associated with the category \"shoes,\" your request body may look like the example below. ```javascript { \"status\": [ \"draft\", \"scheduled\" ], \"categories\": [ \"shoes\" ], } ``` +func (c *ApiService) SearchSingleSend(params *SearchSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends/search" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + body := []byte{} + if params != nil && params.SinglesendSearch != nil { + b, err := json.Marshal(*params.SinglesendSearch) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListSingleSend200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/api_service.go b/rest/api/v3/mc_singlesends/api_service.go new file mode 100644 index 00000000..dbf3b326 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_singlesends/api_update_single_send.go b/rest/api/v3/mc_singlesends/api_update_single_send.go new file mode 100644 index 00000000..ca12d700 --- /dev/null +++ b/rest/api/v3/mc_singlesends/api_update_single_send.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSingleSendParam struct { + // + Id *string `json:"id"` + // + SinglesendRequest *SinglesendRequest `json:"SinglesendRequest,omitempty"` +} + +func (params *UpdateSingleSendParam) SetId(Id string) *UpdateSingleSendParam { + params.Id = &Id + return params +} +func (params *UpdateSingleSendParam) SetSinglesendRequest(SinglesendRequest SinglesendRequest) *UpdateSingleSendParam { + params.SinglesendRequest = &SinglesendRequest + return params +} + +// **This endpoint allows you to update a Single Send using a Single Send ID.** You only need to pass the properties you want to update. Any blank or missing properties will remain unaltered. This endpoint will update a draft of the Single Send but will not send it or schedule it to be sent. Any `send_at` property value set with this endpoint will prepopulate the Single Send's send date. However, the Single Send will remain an unscheduled draft until it's updated with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI. +func (c *ApiService) UpdateSingleSend(params *UpdateSingleSendParam) (interface{}, error) { + path := "/v3/marketing/singlesends/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SinglesendRequest != nil { + b, err := json.Marshal(*params.SinglesendRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &SinglesendResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSingleSend500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_singlesends/docs/AbTestSummary.md b/rest/api/v3/mc_singlesends/docs/AbTestSummary.md new file mode 100644 index 00000000..c0c3c316 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/AbTestSummary.md @@ -0,0 +1,17 @@ +# AbTestSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Type**](Type.md) | What differs between the A/B tests | +**WinnerCriteria** | [**WinnerCriteria**](WinnerCriteria.md) | How the winner will be decided | +**TestPercentage** | **int32** | What percentage of your recipient will be included in your A/B testing | +**Duration** | **string** | How long the A/B Testing will last | +**WinningTemplateId** | **string** | Winner of the A/B Test | +**WinnerSelectedAt** | **string** | When the winner was selected | +**ExpirationDate** | **string** | Last day to select an A/B Test Winner | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/CreateSingleSend.md b/rest/api/v3/mc_singlesends/docs/CreateSingleSend.md new file mode 100644 index 00000000..41b0107b --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/CreateSingleSend.md @@ -0,0 +1,48 @@ +# CreateSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSingleSend**](CreateSingleSend.md#CreateSingleSend) | **Post** /v3/marketing/singlesends | Create Single Send + + + +## CreateSingleSend + +> SinglesendResponse CreateSingleSend(ctx, optional) + +Create Single Send + +**This endpoint allows you to create a new Single Send.** Please note that if you are migrating from the previous version of Single Sends, you no longer need to pass a template ID with your request to this endpoint. Instead, you will pass all template data in the `email_config` object. This endpoint will create a draft of the Single Send but will not send it or schedule it to be sent. Any `send_at` property value set with this endpoint will prepopulate the Single Send's send date. However, the Single Send will remain an unscheduled draft until it's updated with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SinglesendRequest** | [**SinglesendRequest**](SinglesendRequest.md) | + +### Return type + +[**SinglesendResponse**](SinglesendResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/DeleteScheduledSingleSend.md b/rest/api/v3/mc_singlesends/docs/DeleteScheduledSingleSend.md new file mode 100644 index 00000000..e9d4fd0a --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/DeleteScheduledSingleSend.md @@ -0,0 +1,51 @@ +# DeleteScheduledSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteScheduledSingleSend**](DeleteScheduledSingleSend.md#DeleteScheduledSingleSend) | **Delete** /v3/marketing/singlesends/{Id}/schedule | Delete Single Send Schedule + + + +## DeleteScheduledSingleSend + +> SinglesendSchedule DeleteScheduledSingleSend(ctx, Id) + +Delete Single Send Schedule + +**This endpoint allows you to cancel a scheduled Single Send using a Single Send ID.** Making a DELETE request to this endpoint will cancel the scheduled sending of a Single Send. The request will not delete the Single Send itself. Deleting a Single Send can be done by passing a DELETE request to `/marketing/singlesends/{id}`. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteScheduledSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SinglesendSchedule**](SinglesendSchedule.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/DeleteSingleSend.md b/rest/api/v3/mc_singlesends/docs/DeleteSingleSend.md new file mode 100644 index 00000000..9d987dcb --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/DeleteSingleSend.md @@ -0,0 +1,51 @@ +# DeleteSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSingleSend**](DeleteSingleSend.md#DeleteSingleSend) | **Delete** /v3/marketing/singlesends/{Id} | Delete Single Send by ID + + + +## DeleteSingleSend + +> DeleteSingleSend(ctx, Id) + +Delete Single Send by ID + +**This endpoint allows you to delete one Single Send using a Single Send ID.** To first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint. Please note that a `DELETE` request is permanent, and your Single Send will not be recoverable after deletion. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/DeleteSingleSends.md b/rest/api/v3/mc_singlesends/docs/DeleteSingleSends.md new file mode 100644 index 00000000..80c58b83 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/DeleteSingleSends.md @@ -0,0 +1,48 @@ +# DeleteSingleSends + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSingleSends**](DeleteSingleSends.md#DeleteSingleSends) | **Delete** /v3/marketing/singlesends | Bulk Delete Single Sends + + + +## DeleteSingleSends + +> DeleteSingleSends(ctx, optional) + +Bulk Delete Single Sends + +**This endpoint allows you to delete multiple Single Sends using an array of Single Sends IDs.** To first retrieve all your Single Sends' IDs, you can make a GET request to the `/marketing/singlensends` endpoint. Please note that a DELETE request is permanent, and your Single Sends will not be recoverable after deletion. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSingleSendsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Ids** | **[]string** | Single Send IDs to delete + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/DuplicateSingleSend.md b/rest/api/v3/mc_singlesends/docs/DuplicateSingleSend.md new file mode 100644 index 00000000..6a0272f3 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/DuplicateSingleSend.md @@ -0,0 +1,52 @@ +# DuplicateSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DuplicateSingleSend**](DuplicateSingleSend.md#DuplicateSingleSend) | **Post** /v3/marketing/singlesends/{Id} | Duplicate Single Send + + + +## DuplicateSingleSend + +> SinglesendResponse DuplicateSingleSend(ctx, Idoptional) + +Duplicate Single Send + +**This endpoint allows you to duplicate an existing Single Send using its Single Send ID.** Duplicating a Single Send is useful when you want to create a Single Send but don't want to start from scratch. Once duplicated, you can update or edit the Single Send by making a PATCH request to the `/marketing/singlesends/{id}` endpoint. If you leave the `name` field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text “Copy of ” prepended to it. The `name` field length is limited to 100 characters, so the end of the new Single Send name, including “Copy of ”, will be trimmed if the name exceeds this limit. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DuplicateSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**DuplicateSingleSendRequest** | [**DuplicateSingleSendRequest**](DuplicateSingleSendRequest.md) | + +### Return type + +[**SinglesendResponse**](SinglesendResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/DuplicateSingleSendRequest.md b/rest/api/v3/mc_singlesends/docs/DuplicateSingleSendRequest.md new file mode 100644 index 00000000..9b9c44e6 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/DuplicateSingleSendRequest.md @@ -0,0 +1,11 @@ +# DuplicateSingleSendRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the duplicate Single Send. If you choose to leave the name field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text 'Copy of ' prepended to it. The end of the new Single Send name, including 'Copy of ', will be trimmed if the name exceeds the character limit. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Editor.md b/rest/api/v3/mc_singlesends/docs/Editor.md new file mode 100644 index 00000000..9d170841 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Editor.md @@ -0,0 +1,13 @@ +# Editor + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CODE** | string | (value: `"code"`) +**DESIGN** | string | (value: `"design"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Editor1.md b/rest/api/v3/mc_singlesends/docs/Editor1.md new file mode 100644 index 00000000..2ddc5d89 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Editor1.md @@ -0,0 +1,13 @@ +# Editor1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CODE** | string | (value: `"code"`) +**DESIGN** | string | (value: `"design"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/GetSingleSend.md b/rest/api/v3/mc_singlesends/docs/GetSingleSend.md new file mode 100644 index 00000000..0c7434bb --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/GetSingleSend.md @@ -0,0 +1,51 @@ +# GetSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSingleSend**](GetSingleSend.md#GetSingleSend) | **Get** /v3/marketing/singlesends/{Id} | Get Single Send by ID + + + +## GetSingleSend + +> SinglesendResponse GetSingleSend(ctx, Id) + +Get Single Send by ID + +**This endpoint allows you to retrieve details about one Single Send using a Single Send ID.** You can retrieve all of your Single Sends by making a GET request to the `/marketing/singlesends` endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SinglesendResponse**](SinglesendResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/Items.md b/rest/api/v3/mc_singlesends/docs/Items.md new file mode 100644 index 00000000..781c4ec7 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Items.md @@ -0,0 +1,14 @@ +# Items + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DRAFT** | string | (value: `"draft"`) +**SCHEDULED** | string | (value: `"scheduled"`) +**TRIGGERED** | string | (value: `"triggered"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/ListCategory.md b/rest/api/v3/mc_singlesends/docs/ListCategory.md new file mode 100644 index 00000000..4f7a81be --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ListCategory.md @@ -0,0 +1,44 @@ +# ListCategory + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCategory**](ListCategory.md#ListCategory) | **Get** /v3/marketing/singlesends/categories | Get All Categories + + + +## ListCategory + +> ListCategory200Response ListCategory(ctx, ) + +Get All Categories + +**This endpoint allows you to retrieve all the categories associated with your Single Sends.** This endpoint will return your latest 1,000 categories. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCategoryParams struct + + +### Return type + +[**ListCategory200Response**](ListCategory200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/ListCategory200Response.md b/rest/api/v3/mc_singlesends/docs/ListCategory200Response.md new file mode 100644 index 00000000..27af5839 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ListCategory200Response.md @@ -0,0 +1,11 @@ +# ListCategory200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Categories** | **[]string** | list of latest one thousand unique categories associated with all Single Sends in ascending order |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/ListSingleSend.md b/rest/api/v3/mc_singlesends/docs/ListSingleSend.md new file mode 100644 index 00000000..fee8c3fb --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ListSingleSend.md @@ -0,0 +1,49 @@ +# ListSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSingleSend**](ListSingleSend.md#ListSingleSend) | **Get** /v3/marketing/singlesends | Get All Single Sends + + + +## ListSingleSend + +> ListSingleSend200Response ListSingleSend(ctx, optional) + +Get All Single Sends + +**This endpoint allows you to retrieve all your Single Sends.** Returns all of your Single Sends with condensed details about each, including the Single Sends' IDs. For more details about an individual Single Send, pass the Single Send's ID to the `/marketing/singlesends/{id}` endpoint. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **int32** | +**PageToken** | **string** | + +### Return type + +[**ListSingleSend200Response**](ListSingleSend200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/ListSingleSend200Response.md b/rest/api/v3/mc_singlesends/docs/ListSingleSend200Response.md new file mode 100644 index 00000000..8ad91d0e --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ListSingleSend200Response.md @@ -0,0 +1,12 @@ +# ListSingleSend200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]SinglesendResponseShort**](SinglesendResponseShort.md) | |[optional] +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/ListSingleSend500Response.md b/rest/api/v3/mc_singlesends/docs/ListSingleSend500Response.md new file mode 100644 index 00000000..a07c4f3a --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ListSingleSend500Response.md @@ -0,0 +1,11 @@ +# ListSingleSend500Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListSingleSend500ResponseErrorsInner**](ListSingleSend500ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/ListSingleSend500ResponseErrorsInner.md b/rest/api/v3/mc_singlesends/docs/ListSingleSend500ResponseErrorsInner.md new file mode 100644 index 00000000..24c6f3f9 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ListSingleSend500ResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ListSingleSend500ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | |[optional] +**Message** | **string** | |[optional] +**ErrorId** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Metadata.md b/rest/api/v3/mc_singlesends/docs/Metadata.md new file mode 100644 index 00000000..6121300c --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | |[optional] +**Self** | **string** | |[optional] +**Next** | **string** | |[optional] +**Count** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/ScheduleSingleSend.md b/rest/api/v3/mc_singlesends/docs/ScheduleSingleSend.md new file mode 100644 index 00000000..738548c6 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ScheduleSingleSend.md @@ -0,0 +1,52 @@ +# ScheduleSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ScheduleSingleSend**](ScheduleSingleSend.md#ScheduleSingleSend) | **Put** /v3/marketing/singlesends/{Id}/schedule | Schedule Single Send + + + +## ScheduleSingleSend + +> ScheduleSingleSend201Response ScheduleSingleSend(ctx, Idoptional) + +Schedule Single Send + +**This endpoint allows you to send a Single Send immediately or schedule it to be sent at a later time.** To send your message immediately, set the `send_at` property value to the string `now`. To schedule the Single Send for future delivery, set the `send_at` value to your desired send time in [ISO 8601 date time format](https://www.iso.org/iso-8601-date-and-time-format.html) (`yyyy-MM-ddTHH:mm:ssZ`). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a ScheduleSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**ScheduleSingleSendRequest** | [**ScheduleSingleSendRequest**](ScheduleSingleSendRequest.md) | + +### Return type + +[**ScheduleSingleSend201Response**](ScheduleSingleSend201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/ScheduleSingleSend201Response.md b/rest/api/v3/mc_singlesends/docs/ScheduleSingleSend201Response.md new file mode 100644 index 00000000..565341af --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ScheduleSingleSend201Response.md @@ -0,0 +1,12 @@ +# ScheduleSingleSend201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SendAt** | [**time.Time**](time.Time.md) | The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). |[optional] +**Status** | [**Status**](Status.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/ScheduleSingleSendRequest.md b/rest/api/v3/mc_singlesends/docs/ScheduleSingleSendRequest.md new file mode 100644 index 00000000..02842731 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/ScheduleSingleSendRequest.md @@ -0,0 +1,11 @@ +# ScheduleSingleSendRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SendAt** | [**time.Time**](time.Time.md) | The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SearchSingleSend.md b/rest/api/v3/mc_singlesends/docs/SearchSingleSend.md new file mode 100644 index 00000000..cf141ace --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SearchSingleSend.md @@ -0,0 +1,50 @@ +# SearchSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SearchSingleSend**](SearchSingleSend.md#SearchSingleSend) | **Post** /v3/marketing/singlesends/search | Get Single Sends Search + + + +## SearchSingleSend + +> ListSingleSend200Response SearchSingleSend(ctx, optional) + +Get Single Sends Search + +**This endpoint allows you to search for Single Sends based on specified criteria.** You can search for Single Sends by passing a combination of values using the `name`, `status`, and `categories` request body fields. For example, if you want to search for all Single Sends that are \"drafts\" or \"scheduled\" and also associated with the category \"shoes,\" your request body may look like the example below. ```javascript { \"status\": [ \"draft\", \"scheduled\" ], \"categories\": [ \"shoes\" ], } ``` + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a SearchSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **int32** | +**PageToken** | **string** | +**SinglesendSearch** | [**SinglesendSearch**](SinglesendSearch.md) | + +### Return type + +[**ListSingleSend200Response**](ListSingleSend200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendRequest.md b/rest/api/v3/mc_singlesends/docs/SinglesendRequest.md new file mode 100644 index 00000000..b84a5487 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendRequest.md @@ -0,0 +1,15 @@ +# SinglesendRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the Single Send. | +**Categories** | **[]string** | The categories to associate with this Single Send. |[optional] +**SendAt** | [**time.Time**](time.Time.md) | Set this property to an ISO 8601 formatted date-time when you would like to send the Single Send. Please note that any `send_at` property value set with this endpoint will prepopulate the send date in the SendGrid user interface (UI). However, the Single Send will remain an unscheduled draft until it's updated with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI. Additionally, the `now` keyword is a valid `send_at` value only when using the Schedule Single Send endpoint. Setting this property to `now` with this endpoint will cause an error. |[optional] +**SendTo** | [**SinglesendRequestSendTo**](SinglesendRequestSendTo.md) | |[optional] +**EmailConfig** | [**SinglesendRequestEmailConfig**](SinglesendRequestEmailConfig.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendRequestEmailConfig.md b/rest/api/v3/mc_singlesends/docs/SinglesendRequestEmailConfig.md new file mode 100644 index 00000000..633bd086 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendRequestEmailConfig.md @@ -0,0 +1,20 @@ +# SinglesendRequestEmailConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subject** | **string** | The subject line of the Single Send. Do not include this field when using a `design_id`. |[optional] +**HtmlContent** | **string** | The HTML content of the Single Send. Do not include this field when using a `design_id`. |[optional] +**PlainContent** | **string** | The plain text content of the Single Send. Do not include this field when using a `design_id`. |[optional] +**GeneratePlainContent** | **bool** | If set to `true`, `plain_content` is always generated from `html_content`. If set to false, `plain_content` is not altered. |[optional] [default to true] +**DesignId** | **string** | A `design_id` can be used in place of `html_content`, `plain_content`, and/or `subject`. You can retrieve a design's ID from the [\"List Designs\" endpoint](https://docs.sendgrid.com/api-reference/designs-api/list-designs) or by pulling it from the design's detail page URL in the Marketing Campaigns App. |[optional] +**Editor** | [**Editor**](Editor.md) | The editor — `\"design\"` or `\"code\"` — used to modify the Single Send's design in the Marketing Campaigns App. |[optional] +**SuppressionGroupId** | **int32** | The ID of the Suppression Group to allow recipients to unsubscribe — you must provide this or the `custom_unsubscribe_url`. |[optional] +**CustomUnsubscribeUrl** | **string** | The URL allowing recipients to unsubscribe — you must provide this or the `suppression_group_id`. |[optional] +**SenderId** | **int32** | The ID of the verified Sender. You can retrieve a verified Sender's ID from the [\"Get Verified Senders\" endpoint](https://www.twilio.com/docs/sendgrid/api-reference/sender-verification/get-all-verified-senders) or by pulling it from the Sender's detail page URL in the SendGrid App. |[optional] +**IpPool** | **string** | The name of the IP Pool from which the Single Send emails are sent. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendRequestSendTo.md b/rest/api/v3/mc_singlesends/docs/SinglesendRequestSendTo.md new file mode 100644 index 00000000..f1f2d523 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendRequestSendTo.md @@ -0,0 +1,13 @@ +# SinglesendRequestSendTo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ListIds** | **[]string** | The recipient List IDs that will receive the Single Send. |[optional] +**SegmentIds** | **[]string** | The recipient Segment IDs that will receive the Single Send. |[optional] +**All** | **bool** | Set to `true` to send to All Contacts. If set to `false`, at least one `list_ids` or `segment_ids` value must be provided before the Single Send is scheduled to be sent to recipients. |[optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendResponse.md b/rest/api/v3/mc_singlesends/docs/SinglesendResponse.md new file mode 100644 index 00000000..95d0cbcf --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendResponse.md @@ -0,0 +1,20 @@ +# SinglesendResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The unique ID for the Single Send. |[optional] +**Name** | **string** | The name of the Single Send. |[optional] +**Status** | [**Status2**](Status2.md) | The current status of the Single Send. The status may be `draft`, `scheduled`, or `triggered`. |[optional] +**Categories** | **[]string** | The categories associated with this Single Send. |[optional] +**SendAt** | [**time.Time**](time.Time.md) | An ISO 8601 formatted date-time when the Single Send is set to be sent. Please note that any `send_at` property value will have no effect while the Single Send `status` is `draft`. You must update the Single Send with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI to schedule it. |[optional] +**SendTo** | [**SinglesendResponseSendTo**](SinglesendResponseSendTo.md) | |[optional] +**UpdatedAt** | [**time.Time**](time.Time.md) | the ISO 8601 time at which the Single Send was last updated. |[optional] +**CreatedAt** | [**time.Time**](time.Time.md) | the ISO 8601 time at which the Single Send was created. |[optional] +**EmailConfig** | [**SinglesendResponseEmailConfig**](SinglesendResponseEmailConfig.md) | |[optional] +**Warnings** | [**[]SinglesendResponseWarningsInner**](SinglesendResponseWarningsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendResponseEmailConfig.md b/rest/api/v3/mc_singlesends/docs/SinglesendResponseEmailConfig.md new file mode 100644 index 00000000..e9faf1fb --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendResponseEmailConfig.md @@ -0,0 +1,20 @@ +# SinglesendResponseEmailConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subject** | **string** | The subject line of the Single Send. This property is not used when a `design_id` value is set. |[optional] +**HtmlContent** | **string** | The HTML content of the Single Send. This property is not used when a `design_id` value is set. |[optional] +**PlainContent** | **string** | The plain text content of the Single Send. This property is not used when a `design_id` value is set. |[optional] +**GeneratePlainContent** | **bool** | If this property is set to `true`, `plain_content` is always generated from `html_content`. If it's set to false, `plain_content` is not altered. |[optional] [default to true] +**DesignId** | **string** | A `design_id` can be used in place of `html_content`, `plain_content`, and/or `subject`. You can retrieve a design's ID from the [**List Designs** endpoint](https://docs.sendgrid.com/api-reference/designs-api/list-designs) or by pulling it from the design's detail page URL in the Marketing Campaigns App. |[optional] +**Editor** | [**Editor1**](Editor1.md) | The editor, `design` or `code`, used to modify the Single Send's design in the Marketing Campaigns application user interface. |[optional] +**SuppressionGroupId** | **int32** | The ID of the Suppression Group to allow recipients to unsubscribe. You must provide a `suppression_group_id` or the `custom_unsubscribe_url` with your Single Send. |[optional] +**CustomUnsubscribeUrl** | **string** | The URL allowing recipients to unsubscribe. You must provide a `custom_unsubscribe_url` or a `suppression_group_id` with your Single Send. |[optional] +**SenderId** | **int32** | The ID of the verified sender from whom the Single Send will be sent. You can retrieve a verified sender's ID from the [**Get Verified Senders** endpoint](https://www.twilio.com/docs/sendgrid/api-reference/sender-verification/get-all-verified-senders) or by pulling it from the sender's detail page URL in the SendGrid App. |[optional] +**IpPool** | **string** | The name of the IP Pool from which the Single Send emails are sent. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendResponseSendTo.md b/rest/api/v3/mc_singlesends/docs/SinglesendResponseSendTo.md new file mode 100644 index 00000000..d7e33ea8 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendResponseSendTo.md @@ -0,0 +1,13 @@ +# SinglesendResponseSendTo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ListIds** | **[]string** | The IDs of each contact list to which the Single Send will be sent. |[optional] +**SegmentIds** | **[]string** | The IDs of each segment to which the Single Send will be sent. |[optional] +**All** | **bool** | If this property is set to `true`, the Single Send will be sent to all of your contacts. If it's set to `false`, at least one `list_ids` or `segment_ids` value must be provided before the Single Send is scheduled to be sent. |[optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendResponseShort.md b/rest/api/v3/mc_singlesends/docs/SinglesendResponseShort.md new file mode 100644 index 00000000..bfe6a053 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendResponseShort.md @@ -0,0 +1,19 @@ +# SinglesendResponseShort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | +**Name** | **string** | name of the Single Send | +**Abtest** | [**AbTestSummary**](AbTestSummary.md) | | +**Status** | [**Status3**](Status3.md) | current status of the Single Send | +**Categories** | **[]string** | categories to associate with this Single Send | +**SendAt** | [**time.Time**](time.Time.md) | The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). |[optional] +**IsAbtest** | **bool** | true if the Single Send's AB Test functionality has been toggled on | +**UpdatedAt** | [**time.Time**](time.Time.md) | the ISO 8601 time at which the Single Send was last updated | +**CreatedAt** | [**time.Time**](time.Time.md) | the ISO 8601 time at which the Single Send was created | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendResponseWarningsInner.md b/rest/api/v3/mc_singlesends/docs/SinglesendResponseWarningsInner.md new file mode 100644 index 00000000..15c969c3 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendResponseWarningsInner.md @@ -0,0 +1,13 @@ +# SinglesendResponseWarningsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**Field** | **string** | |[optional] +**WarningId** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendSchedule.md b/rest/api/v3/mc_singlesends/docs/SinglesendSchedule.md new file mode 100644 index 00000000..df6d4402 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendSchedule.md @@ -0,0 +1,12 @@ +# SinglesendSchedule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SendAt** | [**time.Time**](time.Time.md) | The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). | +**Status** | [**Status1**](Status1.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/SinglesendSearch.md b/rest/api/v3/mc_singlesends/docs/SinglesendSearch.md new file mode 100644 index 00000000..79589188 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/SinglesendSearch.md @@ -0,0 +1,13 @@ +# SinglesendSearch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | leading and trailing wildcard search on name of the Single Send |[optional] +**Status** | [**[]Items**](Items.md) | current status of the Single Send |[optional] +**Categories** | **[]string** | categories to associate with this Single Send, match any single send that has at least one of the categories |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Status.md b/rest/api/v3/mc_singlesends/docs/Status.md new file mode 100644 index 00000000..533fff83 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Status.md @@ -0,0 +1,12 @@ +# Status + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SCHEDULED** | string | (value: `"scheduled"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Status1.md b/rest/api/v3/mc_singlesends/docs/Status1.md new file mode 100644 index 00000000..b19ad21b --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Status1.md @@ -0,0 +1,14 @@ +# Status1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DRAFT** | string | (value: `"draft"`) +**SCHEDULED** | string | (value: `"scheduled"`) +**TRIGGERED** | string | (value: `"triggered"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Status2.md b/rest/api/v3/mc_singlesends/docs/Status2.md new file mode 100644 index 00000000..eb4cca4d --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Status2.md @@ -0,0 +1,14 @@ +# Status2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DRAFT** | string | (value: `"draft"`) +**SCHEDULED** | string | (value: `"scheduled"`) +**TRIGGERED** | string | (value: `"triggered"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Status3.md b/rest/api/v3/mc_singlesends/docs/Status3.md new file mode 100644 index 00000000..1b7a0104 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Status3.md @@ -0,0 +1,14 @@ +# Status3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DRAFT** | string | (value: `"draft"`) +**SCHEDULED** | string | (value: `"scheduled"`) +**TRIGGERED** | string | (value: `"triggered"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/Type.md b/rest/api/v3/mc_singlesends/docs/Type.md new file mode 100644 index 00000000..1ea1cee4 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/Type.md @@ -0,0 +1,13 @@ +# Type + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SUBJECT** | string | (value: `"subject"`) +**CONTENT** | string | (value: `"content"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/docs/UpdateSingleSend.md b/rest/api/v3/mc_singlesends/docs/UpdateSingleSend.md new file mode 100644 index 00000000..9614a701 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/UpdateSingleSend.md @@ -0,0 +1,52 @@ +# UpdateSingleSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSingleSend**](UpdateSingleSend.md#UpdateSingleSend) | **Patch** /v3/marketing/singlesends/{Id} | Update Single Send + + + +## UpdateSingleSend + +> SinglesendResponse UpdateSingleSend(ctx, Idoptional) + +Update Single Send + +**This endpoint allows you to update a Single Send using a Single Send ID.** You only need to pass the properties you want to update. Any blank or missing properties will remain unaltered. This endpoint will update a draft of the Single Send but will not send it or schedule it to be sent. Any `send_at` property value set with this endpoint will prepopulate the Single Send's send date. However, the Single Send will remain an unscheduled draft until it's updated with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSingleSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SinglesendRequest** | [**SinglesendRequest**](SinglesendRequest.md) | + +### Return type + +[**SinglesendResponse**](SinglesendResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_singlesends/docs/WinnerCriteria.md b/rest/api/v3/mc_singlesends/docs/WinnerCriteria.md new file mode 100644 index 00000000..d35ce1e3 --- /dev/null +++ b/rest/api/v3/mc_singlesends/docs/WinnerCriteria.md @@ -0,0 +1,14 @@ +# WinnerCriteria + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**OPEN** | string | (value: `"open"`) +**CLICK** | string | (value: `"click"`) +**MANUAL** | string | (value: `"manual"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_singlesends/model_ab_test_summary.go b/rest/api/v3/mc_singlesends/model_ab_test_summary.go new file mode 100644 index 00000000..c7a67236 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_ab_test_summary.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AbTestSummary struct for AbTestSummary +type AbTestSummary struct { + // What differs between the A/B tests + Type Type `json:"type"` + // How the winner will be decided + WinnerCriteria WinnerCriteria `json:"winner_criteria"` + // What percentage of your recipient will be included in your A/B testing + TestPercentage int32 `json:"test_percentage"` + // How long the A/B Testing will last + Duration string `json:"duration"` + // Winner of the A/B Test + WinningTemplateId string `json:"winning_template_id"` + // When the winner was selected + WinnerSelectedAt string `json:"winner_selected_at"` + // Last day to select an A/B Test Winner + ExpirationDate string `json:"expiration_date"` +} diff --git a/rest/api/v3/mc_singlesends/model_duplicate_single_send_request.go b/rest/api/v3/mc_singlesends/model_duplicate_single_send_request.go new file mode 100644 index 00000000..48f96a53 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_duplicate_single_send_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DuplicateSingleSendRequest struct for DuplicateSingleSendRequest +type DuplicateSingleSendRequest struct { + // The name of the duplicate Single Send. If you choose to leave the name field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text 'Copy of ' prepended to it. The end of the new Single Send name, including 'Copy of ', will be trimmed if the name exceeds the character limit. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_editor.go b/rest/api/v3/mc_singlesends/model_editor.go new file mode 100644 index 00000000..d498173d --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_editor.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Editor the model 'Editor' +type Editor string + +// List of Editor +const ( + EDITOR_CODE Editor = "code" + EDITOR_DESIGN Editor = "design" +) diff --git a/rest/api/v3/mc_singlesends/model_editor1.go b/rest/api/v3/mc_singlesends/model_editor1.go new file mode 100644 index 00000000..b5e0aff7 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_editor1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Editor1 the model 'Editor1' +type Editor1 string + +// List of Editor1 +const ( + EDITOR1_CODE Editor1 = "code" + EDITOR1_DESIGN Editor1 = "design" +) diff --git a/rest/api/v3/mc_singlesends/model_items.go b/rest/api/v3/mc_singlesends/model_items.go new file mode 100644 index 00000000..cb49393e --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_items.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items the model 'Items' +type Items string + +// List of Items +const ( + ITEMS_DRAFT Items = "draft" + ITEMS_SCHEDULED Items = "scheduled" + ITEMS_TRIGGERED Items = "triggered" +) diff --git a/rest/api/v3/mc_singlesends/model_list_category_200_response.go b/rest/api/v3/mc_singlesends/model_list_category_200_response.go new file mode 100644 index 00000000..53e5017a --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_list_category_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCategory200Response struct for ListCategory200Response +type ListCategory200Response struct { + // list of latest one thousand unique categories associated with all Single Sends in ascending order + Categories *[]string `json:"categories,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_list_single_send_200_response.go b/rest/api/v3/mc_singlesends/model_list_single_send_200_response.go new file mode 100644 index 00000000..655bd91e --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_list_single_send_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSingleSend200Response struct for ListSingleSend200Response +type ListSingleSend200Response struct { + Result *[]SinglesendResponseShort `json:"result,omitempty"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_list_single_send_500_response.go b/rest/api/v3/mc_singlesends/model_list_single_send_500_response.go new file mode 100644 index 00000000..4475e149 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_list_single_send_500_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSingleSend500Response struct for ListSingleSend500Response +type ListSingleSend500Response struct { + Errors *[]ListSingleSend500ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_list_single_send_500_response_errors_inner.go b/rest/api/v3/mc_singlesends/model_list_single_send_500_response_errors_inner.go new file mode 100644 index 00000000..00fae477 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_list_single_send_500_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSingleSend500ResponseErrorsInner struct for ListSingleSend500ResponseErrorsInner +type ListSingleSend500ResponseErrorsInner struct { + Field *string `json:"field,omitempty"` + Message *string `json:"message,omitempty"` + ErrorId *string `json:"error_id,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_metadata.go b/rest/api/v3/mc_singlesends/model_metadata.go new file mode 100644 index 00000000..56fb60e7 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_metadata.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + Prev *string `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + Next *string `json:"next,omitempty"` + Count *int32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_schedule_single_send_201_response.go b/rest/api/v3/mc_singlesends/model_schedule_single_send_201_response.go new file mode 100644 index 00000000..01d2c672 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_schedule_single_send_201_response.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// ScheduleSingleSend201Response struct for ScheduleSingleSend201Response +type ScheduleSingleSend201Response struct { + // The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). + SendAt *time.Time `json:"send_at,omitempty"` + Status *Status `json:"status,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_schedule_single_send_request.go b/rest/api/v3/mc_singlesends/model_schedule_single_send_request.go new file mode 100644 index 00000000..cf2c6448 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_schedule_single_send_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// ScheduleSingleSendRequest struct for ScheduleSingleSendRequest +type ScheduleSingleSendRequest struct { + // The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). + SendAt time.Time `json:"send_at"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_request.go b/rest/api/v3/mc_singlesends/model_singlesend_request.go new file mode 100644 index 00000000..790d1be9 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_request.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// SinglesendRequest struct for SinglesendRequest +type SinglesendRequest struct { + // The name of the Single Send. + Name string `json:"name"` + // The categories to associate with this Single Send. + Categories *[]string `json:"categories,omitempty"` + // Set this property to an ISO 8601 formatted date-time when you would like to send the Single Send. Please note that any `send_at` property value set with this endpoint will prepopulate the send date in the SendGrid user interface (UI). However, the Single Send will remain an unscheduled draft until it's updated with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI. Additionally, the `now` keyword is a valid `send_at` value only when using the Schedule Single Send endpoint. Setting this property to `now` with this endpoint will cause an error. + SendAt *time.Time `json:"send_at,omitempty"` + SendTo *SinglesendRequestSendTo `json:"send_to,omitempty"` + EmailConfig *SinglesendRequestEmailConfig `json:"email_config,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_request_email_config.go b/rest/api/v3/mc_singlesends/model_singlesend_request_email_config.go new file mode 100644 index 00000000..666324db --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_request_email_config.go @@ -0,0 +1,38 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendRequestEmailConfig struct for SinglesendRequestEmailConfig +type SinglesendRequestEmailConfig struct { + // The subject line of the Single Send. Do not include this field when using a `design_id`. + Subject *string `json:"subject,omitempty"` + // The HTML content of the Single Send. Do not include this field when using a `design_id`. + HtmlContent *string `json:"html_content,omitempty"` + // The plain text content of the Single Send. Do not include this field when using a `design_id`. + PlainContent *string `json:"plain_content,omitempty"` + // If set to `true`, `plain_content` is always generated from `html_content`. If set to false, `plain_content` is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // A `design_id` can be used in place of `html_content`, `plain_content`, and/or `subject`. You can retrieve a design's ID from the [\"List Designs\" endpoint](https://docs.sendgrid.com/api-reference/designs-api/list-designs) or by pulling it from the design's detail page URL in the Marketing Campaigns App. + DesignId *string `json:"design_id,omitempty"` + // The editor — `\"design\"` or `\"code\"` — used to modify the Single Send's design in the Marketing Campaigns App. + Editor *Editor `json:"editor,omitempty"` + // The ID of the Suppression Group to allow recipients to unsubscribe — you must provide this or the `custom_unsubscribe_url`. + SuppressionGroupId *int32 `json:"suppression_group_id,omitempty"` + // The URL allowing recipients to unsubscribe — you must provide this or the `suppression_group_id`. + CustomUnsubscribeUrl *string `json:"custom_unsubscribe_url,omitempty"` + // The ID of the verified Sender. You can retrieve a verified Sender's ID from the [\"Get Verified Senders\" endpoint](https://www.twilio.com/docs/sendgrid/api-reference/sender-verification/get-all-verified-senders) or by pulling it from the Sender's detail page URL in the SendGrid App. + SenderId *int32 `json:"sender_id,omitempty"` + // The name of the IP Pool from which the Single Send emails are sent. + IpPool *string `json:"ip_pool,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_request_send_to.go b/rest/api/v3/mc_singlesends/model_singlesend_request_send_to.go new file mode 100644 index 00000000..5de4bf4b --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_request_send_to.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendRequestSendTo struct for SinglesendRequestSendTo +type SinglesendRequestSendTo struct { + // The recipient List IDs that will receive the Single Send. + ListIds *[]string `json:"list_ids,omitempty"` + // The recipient Segment IDs that will receive the Single Send. + SegmentIds *[]string `json:"segment_ids,omitempty"` + // Set to `true` to send to All Contacts. If set to `false`, at least one `list_ids` or `segment_ids` value must be provided before the Single Send is scheduled to be sent to recipients. + All *bool `json:"all,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_response.go b/rest/api/v3/mc_singlesends/model_singlesend_response.go new file mode 100644 index 00000000..580d2fe2 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_response.go @@ -0,0 +1,39 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// SinglesendResponse struct for SinglesendResponse +type SinglesendResponse struct { + // The unique ID for the Single Send. + Id *string `json:"id,omitempty"` + // The name of the Single Send. + Name *string `json:"name,omitempty"` + // The current status of the Single Send. The status may be `draft`, `scheduled`, or `triggered`. + Status *Status2 `json:"status,omitempty"` + // The categories associated with this Single Send. + Categories *[]string `json:"categories,omitempty"` + // An ISO 8601 formatted date-time when the Single Send is set to be sent. Please note that any `send_at` property value will have no effect while the Single Send `status` is `draft`. You must update the Single Send with the [**Schedule Single Send**](https://docs.sendgrid.com/api-reference/single-sends/schedule-single-send) endpoint or SendGrid application UI to schedule it. + SendAt *time.Time `json:"send_at,omitempty"` + SendTo *SinglesendResponseSendTo `json:"send_to,omitempty"` + // the ISO 8601 time at which the Single Send was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // the ISO 8601 time at which the Single Send was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + EmailConfig *SinglesendResponseEmailConfig `json:"email_config,omitempty"` + Warnings *[]SinglesendResponseWarningsInner `json:"warnings,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_response_email_config.go b/rest/api/v3/mc_singlesends/model_singlesend_response_email_config.go new file mode 100644 index 00000000..678c3ac1 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_response_email_config.go @@ -0,0 +1,38 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendResponseEmailConfig struct for SinglesendResponseEmailConfig +type SinglesendResponseEmailConfig struct { + // The subject line of the Single Send. This property is not used when a `design_id` value is set. + Subject *string `json:"subject,omitempty"` + // The HTML content of the Single Send. This property is not used when a `design_id` value is set. + HtmlContent *string `json:"html_content,omitempty"` + // The plain text content of the Single Send. This property is not used when a `design_id` value is set. + PlainContent *string `json:"plain_content,omitempty"` + // If this property is set to `true`, `plain_content` is always generated from `html_content`. If it's set to false, `plain_content` is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // A `design_id` can be used in place of `html_content`, `plain_content`, and/or `subject`. You can retrieve a design's ID from the [**List Designs** endpoint](https://docs.sendgrid.com/api-reference/designs-api/list-designs) or by pulling it from the design's detail page URL in the Marketing Campaigns App. + DesignId *string `json:"design_id,omitempty"` + // The editor, `design` or `code`, used to modify the Single Send's design in the Marketing Campaigns application user interface. + Editor *Editor1 `json:"editor,omitempty"` + // The ID of the Suppression Group to allow recipients to unsubscribe. You must provide a `suppression_group_id` or the `custom_unsubscribe_url` with your Single Send. + SuppressionGroupId *int32 `json:"suppression_group_id,omitempty"` + // The URL allowing recipients to unsubscribe. You must provide a `custom_unsubscribe_url` or a `suppression_group_id` with your Single Send. + CustomUnsubscribeUrl *string `json:"custom_unsubscribe_url,omitempty"` + // The ID of the verified sender from whom the Single Send will be sent. You can retrieve a verified sender's ID from the [**Get Verified Senders** endpoint](https://www.twilio.com/docs/sendgrid/api-reference/sender-verification/get-all-verified-senders) or by pulling it from the sender's detail page URL in the SendGrid App. + SenderId *int32 `json:"sender_id,omitempty"` + // The name of the IP Pool from which the Single Send emails are sent. + IpPool *string `json:"ip_pool,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_response_send_to.go b/rest/api/v3/mc_singlesends/model_singlesend_response_send_to.go new file mode 100644 index 00000000..fee100a5 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_response_send_to.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendResponseSendTo struct for SinglesendResponseSendTo +type SinglesendResponseSendTo struct { + // The IDs of each contact list to which the Single Send will be sent. + ListIds *[]string `json:"list_ids,omitempty"` + // The IDs of each segment to which the Single Send will be sent. + SegmentIds *[]string `json:"segment_ids,omitempty"` + // If this property is set to `true`, the Single Send will be sent to all of your contacts. If it's set to `false`, at least one `list_ids` or `segment_ids` value must be provided before the Single Send is scheduled to be sent. + All *bool `json:"all,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_response_short.go b/rest/api/v3/mc_singlesends/model_singlesend_response_short.go new file mode 100644 index 00000000..dcf0ed8f --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_response_short.go @@ -0,0 +1,38 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// SinglesendResponseShort struct for SinglesendResponseShort +type SinglesendResponseShort struct { + Id string `json:"id"` + // name of the Single Send + Name string `json:"name"` + Abtest AbTestSummary `json:"abtest"` + // current status of the Single Send + Status Status3 `json:"status"` + // categories to associate with this Single Send + Categories []string `json:"categories"` + // The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). + SendAt *time.Time `json:"send_at,omitempty"` + // true if the Single Send's AB Test functionality has been toggled on + IsAbtest bool `json:"is_abtest"` + // the ISO 8601 time at which the Single Send was last updated + UpdatedAt time.Time `json:"updated_at"` + // the ISO 8601 time at which the Single Send was created + CreatedAt time.Time `json:"created_at"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_response_warnings_inner.go b/rest/api/v3/mc_singlesends/model_singlesend_response_warnings_inner.go new file mode 100644 index 00000000..7a9ce910 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_response_warnings_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendResponseWarningsInner struct for SinglesendResponseWarningsInner +type SinglesendResponseWarningsInner struct { + Message *string `json:"message,omitempty"` + Field *string `json:"field,omitempty"` + WarningId *string `json:"warning_id,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_schedule.go b/rest/api/v3/mc_singlesends/model_singlesend_schedule.go new file mode 100644 index 00000000..b0902355 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_schedule.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// SinglesendSchedule struct for SinglesendSchedule +type SinglesendSchedule struct { + // The ISO 8601 time at which to send the Single Send. This must be in future or the string `now`. SendGrid [Mail Send](https://docs.sendgrid.com/api-reference/mail-send/mail-send) emails can be scheduled up to 72 hours in advance. However, this scheduling constraint does not apply to emails sent via [Marketing Campaigns](https://docs.sendgrid.com/ui/sending-email/how-to-send-email-with-marketing-campaigns/). + SendAt time.Time `json:"send_at"` + Status *Status1 `json:"status,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_singlesend_search.go b/rest/api/v3/mc_singlesends/model_singlesend_search.go new file mode 100644 index 00000000..c4576308 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_singlesend_search.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendSearch struct for SinglesendSearch +type SinglesendSearch struct { + // leading and trailing wildcard search on name of the Single Send + Name *string `json:"name,omitempty"` + // current status of the Single Send + Status *[]Items `json:"status,omitempty"` + // categories to associate with this Single Send, match any single send that has at least one of the categories + Categories *[]string `json:"categories,omitempty"` +} diff --git a/rest/api/v3/mc_singlesends/model_status.go b/rest/api/v3/mc_singlesends/model_status.go new file mode 100644 index 00000000..7e88d91f --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_status.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status the model 'Status' +type Status string + +// List of Status +const ( + STATUS_SCHEDULED Status = "scheduled" +) diff --git a/rest/api/v3/mc_singlesends/model_status1.go b/rest/api/v3/mc_singlesends/model_status1.go new file mode 100644 index 00000000..90636c6e --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_status1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status1 the model 'Status1' +type Status1 string + +// List of Status1 +const ( + STATUS1_DRAFT Status1 = "draft" + STATUS1_SCHEDULED Status1 = "scheduled" + STATUS1_TRIGGERED Status1 = "triggered" +) diff --git a/rest/api/v3/mc_singlesends/model_status2.go b/rest/api/v3/mc_singlesends/model_status2.go new file mode 100644 index 00000000..42c16a05 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_status2.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status2 the model 'Status2' +type Status2 string + +// List of Status2 +const ( + STATUS2_DRAFT Status2 = "draft" + STATUS2_SCHEDULED Status2 = "scheduled" + STATUS2_TRIGGERED Status2 = "triggered" +) diff --git a/rest/api/v3/mc_singlesends/model_status3.go b/rest/api/v3/mc_singlesends/model_status3.go new file mode 100644 index 00000000..7caa1f9d --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_status3.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status3 the model 'Status3' +type Status3 string + +// List of Status3 +const ( + STATUS3_DRAFT Status3 = "draft" + STATUS3_SCHEDULED Status3 = "scheduled" + STATUS3_TRIGGERED Status3 = "triggered" +) diff --git a/rest/api/v3/mc_singlesends/model_type.go b/rest/api/v3/mc_singlesends/model_type.go new file mode 100644 index 00000000..a2fc86e3 --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_SUBJECT Type = "subject" + TYPE_CONTENT Type = "content" +) diff --git a/rest/api/v3/mc_singlesends/model_winner_criteria.go b/rest/api/v3/mc_singlesends/model_winner_criteria.go new file mode 100644 index 00000000..069e7c0f --- /dev/null +++ b/rest/api/v3/mc_singlesends/model_winner_criteria.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Single Sends API +* The Twilio SendGrid Single Sends API allows you to create, manage, and send Single Sends. You can also search Single Sends and retrieve statistics about them to help you maintain, alter, and further develop your campaigns. A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. You can also create and manage Single Sends in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/single-sends). The Single Sends API changed on May 6, 2020. See [**Single Sends 2020 Update**](https://docs.sendgrid.com/for-developers/sending-email/single-sends-2020-update) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// WinnerCriteria the model 'WinnerCriteria' +type WinnerCriteria string + +// List of WinnerCriteria +const ( + WINNERCRITERIA_OPEN WinnerCriteria = "open" + WINNERCRITERIA_CLICK WinnerCriteria = "click" + WINNERCRITERIA_MANUAL WinnerCriteria = "manual" +) diff --git a/rest/api/v3/mc_stats/README.md b/rest/api/v3/mc_stats/README.md new file mode 100644 index 00000000..bf3ec742 --- /dev/null +++ b/rest/api/v3/mc_stats/README.md @@ -0,0 +1,88 @@ +# Go API client for + +The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). + +This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.236131+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ExportAutomationStat* | [**ExportAutomationStat**](docs/ExportAutomationStat.md#exportautomationstat) | **Get** /v3/marketing/stats/automations/export | Export Single Send Stats +*ExportSingleSendStat* | [**ExportSingleSendStat**](docs/ExportSingleSendStat.md#exportsinglesendstat) | **Get** /v3/marketing/stats/singlesends/export | Export Single Send Stats +*GetAutomationStat* | [**GetAutomationStat**](docs/GetAutomationStat.md#getautomationstat) | **Get** /v3/marketing/stats/automations/{Id} | Get Automation Stats by ID +*GetSingleSendStat* | [**GetSingleSendStat**](docs/GetSingleSendStat.md#getsinglesendstat) | **Get** /v3/marketing/stats/singlesends/{Id} | Get Single Send Stats by ID +*ListAutomationStat* | [**ListAutomationStat**](docs/ListAutomationStat.md#listautomationstat) | **Get** /v3/marketing/stats/automations | Get All Automation Stats +*ListClickTrackingStat* | [**ListClickTrackingStat**](docs/ListClickTrackingStat.md#listclicktrackingstat) | **Get** /v3/marketing/stats/automations/{Id}/links | Get Automation Click Tracking Stats by ID +*ListSingleSendStat* | [**ListSingleSendStat**](docs/ListSingleSendStat.md#listsinglesendstat) | **Get** /v3/marketing/stats/singlesends | Get All Single Sends Stats +*ListSingleSendTrackingStat* | [**ListSingleSendTrackingStat**](docs/ListSingleSendTrackingStat.md#listsinglesendtrackingstat) | **Get** /v3/marketing/stats/singlesends/{Id}/links | Get Single Send Click Tracking Stats by ID + + +## Documentation For Models + + - [AbPhase](AbPhase.md) + - [AbPhase1](AbPhase1.md) + - [AbPhaseId](AbPhaseId.md) + - [AggregatedBy](AggregatedBy.md) + - [AutmoationsLinkStatsResponse](AutmoationsLinkStatsResponse.md) + - [AutmoationsLinkStatsResponseResultsInner](AutmoationsLinkStatsResponseResultsInner.md) + - [AutomationsResponse](AutomationsResponse.md) + - [AutomationsResponseResultsInner](AutomationsResponseResultsInner.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [Items](Items.md) + - [Items1](Items1.md) + - [Items2](Items2.md) + - [LinkTrackingMetadata](LinkTrackingMetadata.md) + - [Metadata](Metadata.md) + - [Metrics](Metrics.md) + - [SinglesendsLinkStatsResponse](SinglesendsLinkStatsResponse.md) + - [SinglesendsLinkStatsResponseResultsInner](SinglesendsLinkStatsResponseResultsInner.md) + - [SinglesendsResponse](SinglesendsResponse.md) + - [SinglesendsResponseResultsInner](SinglesendsResponseResultsInner.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_stats/api_export_automation_stat.go b/rest/api/v3/mc_stats/api_export_automation_stat.go new file mode 100644 index 00000000..4d7ffc17 --- /dev/null +++ b/rest/api/v3/mc_stats/api_export_automation_stat.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ExportAutomationStatParam struct { + // The IDs of Single Sends for which to export stats. + Ids *[]string `json:"ids,omitempty"` + // The [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented; i.e. `\"America/Chicago\"`. This parameter changes the timezone format only; it does not alter which stats are returned. + Timezone *string `json:"timezone,omitempty"` +} + +func (params *ExportAutomationStatParam) SetIds(Ids []string) *ExportAutomationStatParam { + params.Ids = &Ids + return params +} +func (params *ExportAutomationStatParam) SetTimezone(Timezone string) *ExportAutomationStatParam { + params.Timezone = &Timezone + return params +} + +// **This endpoint allows you to export Single Send stats as .CSV data**. You can specify one Single Send or many: include as many Single Send IDs as you need, separating them with commas, as the value of the `ids` query string parameter. The data is returned as plain text response but in .CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a .csv file. +func (c *ApiService) ExportAutomationStat(params *ExportAutomationStatParam) (interface{}, error) { + path := "/v3/marketing/stats/automations/export" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ids != nil { + for _, item := range *params.Ids { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("ids", string(v)) + + } + } + if params != nil && params.Timezone != nil { + data.Set("timezone", *params.Timezone) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + s := "" + ps := &s + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_export_single_send_stat.go b/rest/api/v3/mc_stats/api_export_single_send_stat.go new file mode 100644 index 00000000..721aa2c3 --- /dev/null +++ b/rest/api/v3/mc_stats/api_export_single_send_stat.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ExportSingleSendStatParam struct { + // The IDs of Single Sends for which to export stats. + Ids *[]string `json:"ids,omitempty"` + // The [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented; i.e. `\"America/Chicago\"`. This parameter changes the timezone format only; it does not alter which stats are returned. + Timezone *string `json:"timezone,omitempty"` +} + +func (params *ExportSingleSendStatParam) SetIds(Ids []string) *ExportSingleSendStatParam { + params.Ids = &Ids + return params +} +func (params *ExportSingleSendStatParam) SetTimezone(Timezone string) *ExportSingleSendStatParam { + params.Timezone = &Timezone + return params +} + +// **This endpoint allows you to export Single Send stats as .CSV data**. You can specify one Single Send or many: include as many Single Send IDs as you need, separating them with commas, as the value of the `ids` query string parameter. The data is returned as plain text response but in .CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a .csv file. +func (c *ApiService) ExportSingleSendStat(params *ExportSingleSendStatParam) (interface{}, error) { + path := "/v3/marketing/stats/singlesends/export" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Ids != nil { + for _, item := range *params.Ids { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("ids", string(v)) + + } + } + if params != nil && params.Timezone != nil { + data.Set("timezone", *params.Timezone) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + s := "" + ps := &s + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_get_automation_stat.go b/rest/api/v3/mc_stats/api_get_automation_stat.go new file mode 100644 index 00000000..4a82a99d --- /dev/null +++ b/rest/api/v3/mc_stats/api_get_automation_stat.go @@ -0,0 +1,161 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetAutomationStatParam struct { + // The ID of the Automation for which you want to retrieve statistics. + Id *string `json:"id"` + // Automations can have multiple steps. Including `step_id` as a `group_by` metric allows further granularity of stats. + GroupBy *[]Items `json:"group_by,omitempty"` + // Comma-separated list of `step_ids` that you want the link stats for. + StepIds *[]string `json:"step_ids,omitempty"` + // Dictates how the stats are time-sliced. Currently, `\"total\"` and `\"day\"` are supported. + AggregatedBy *AggregatedBy `json:"aggregated_by,omitempty"` + // Format: `YYYY-MM-DD`. If this parameter is included, the stats' start date is included in the search. + StartDate *string `json:"start_date,omitempty"` + // Format: `YYYY-MM-DD`.If this parameter is included, the stats' end date is included in the search. + EndDate *string `json:"end_date,omitempty"` + // [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented, e.g., \"America/Chicago\". + Timezone *string `json:"timezone,omitempty"` + // The number of elements you want returned on each page. + PageSize *int32 `json:"page_size,omitempty"` + // The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + PageToken *string `json:"page_token,omitempty"` +} + +func (params *GetAutomationStatParam) SetId(Id string) *GetAutomationStatParam { + params.Id = &Id + return params +} +func (params *GetAutomationStatParam) SetGroupBy(GroupBy []Items) *GetAutomationStatParam { + params.GroupBy = &GroupBy + return params +} +func (params *GetAutomationStatParam) SetStepIds(StepIds []string) *GetAutomationStatParam { + params.StepIds = &StepIds + return params +} +func (params *GetAutomationStatParam) SetAggregatedBy(AggregatedBy AggregatedBy) *GetAutomationStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *GetAutomationStatParam) SetStartDate(StartDate string) *GetAutomationStatParam { + params.StartDate = &StartDate + return params +} +func (params *GetAutomationStatParam) SetEndDate(EndDate string) *GetAutomationStatParam { + params.EndDate = &EndDate + return params +} +func (params *GetAutomationStatParam) SetTimezone(Timezone string) *GetAutomationStatParam { + params.Timezone = &Timezone + return params +} +func (params *GetAutomationStatParam) SetPageSize(PageSize int32) *GetAutomationStatParam { + params.PageSize = &PageSize + return params +} +func (params *GetAutomationStatParam) SetPageToken(PageToken string) *GetAutomationStatParam { + params.PageToken = &PageToken + return params +} + +// **This endpoint allows you to retrieve stats for a single Automation using its ID.** Multiple Automation IDs can be retrieved using the \"Get All Automation Stats\" endpoint. Once you have an ID, this endpoint will return detailed stats for the single automation specified. You may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned. +func (c *ApiService) GetAutomationStat(params *GetAutomationStatParam) (interface{}, error) { + path := "/v3/marketing/stats/automations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.GroupBy != nil { + for _, item := range *params.GroupBy { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("group_by", string(v)) + + } + } + if params != nil && params.StepIds != nil { + for _, item := range *params.StepIds { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("step_ids", string(v)) + + } + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.StartDate != nil { + data.Set("start_date", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.Timezone != nil { + data.Set("timezone", *params.Timezone) + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AutomationsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_get_single_send_stat.go b/rest/api/v3/mc_stats/api_get_single_send_stat.go new file mode 100644 index 00000000..bfdfb2d9 --- /dev/null +++ b/rest/api/v3/mc_stats/api_get_single_send_stat.go @@ -0,0 +1,143 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetSingleSendStatParam struct { + // The ID of Single Send for which you want to retrieve stats. + Id *string `json:"id"` + // Dictates how the stats are time-sliced. Currently, `\"total\"` and `\"day\"` are supported. + AggregatedBy *AggregatedBy `json:"aggregated_by,omitempty"` + // Format: `YYYY-MM-DD`. If this parameter is included, the stats' start date is included in the search. + StartDate *string `json:"start_date,omitempty"` + // Format: `YYYY-MM-DD`.If this parameter is included, the stats' end date is included in the search. + EndDate *string `json:"end_date,omitempty"` + // [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented, e.g., \"America/Chicago\". + Timezone *string `json:"timezone,omitempty"` + // The number of elements you want returned on each page. + PageSize *int32 `json:"page_size,omitempty"` + // The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + PageToken *string `json:"page_token,omitempty"` + // A/B Single Sends have multiple variation IDs and phase IDs. Including these additional fields allows further granularity of stats by these fields. + GroupBy *[]Items1 `json:"group_by,omitempty"` +} + +func (params *GetSingleSendStatParam) SetId(Id string) *GetSingleSendStatParam { + params.Id = &Id + return params +} +func (params *GetSingleSendStatParam) SetAggregatedBy(AggregatedBy AggregatedBy) *GetSingleSendStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *GetSingleSendStatParam) SetStartDate(StartDate string) *GetSingleSendStatParam { + params.StartDate = &StartDate + return params +} +func (params *GetSingleSendStatParam) SetEndDate(EndDate string) *GetSingleSendStatParam { + params.EndDate = &EndDate + return params +} +func (params *GetSingleSendStatParam) SetTimezone(Timezone string) *GetSingleSendStatParam { + params.Timezone = &Timezone + return params +} +func (params *GetSingleSendStatParam) SetPageSize(PageSize int32) *GetSingleSendStatParam { + params.PageSize = &PageSize + return params +} +func (params *GetSingleSendStatParam) SetPageToken(PageToken string) *GetSingleSendStatParam { + params.PageToken = &PageToken + return params +} +func (params *GetSingleSendStatParam) SetGroupBy(GroupBy []Items1) *GetSingleSendStatParam { + params.GroupBy = &GroupBy + return params +} + +// **This endpoint allows you to retrieve stats for an individual Single Send using a Single Send ID.** Multiple Single Send IDs can be retrieved using the \"Get All Single Sends Stats\" endpoint. Once you have an ID, this endpoint will return detailed stats for the Single Send specified. You may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned. +func (c *ApiService) GetSingleSendStat(params *GetSingleSendStatParam) (interface{}, error) { + path := "/v3/marketing/stats/singlesends/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.StartDate != nil { + data.Set("start_date", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.Timezone != nil { + data.Set("timezone", *params.Timezone) + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + if params != nil && params.GroupBy != nil { + for _, item := range *params.GroupBy { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("group_by", string(v)) + + } + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SinglesendsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_list_automation_stat.go b/rest/api/v3/mc_stats/api_list_automation_stat.go new file mode 100644 index 00000000..d2dc34e0 --- /dev/null +++ b/rest/api/v3/mc_stats/api_list_automation_stat.go @@ -0,0 +1,96 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListAutomationStatParam struct { + // This endpoint returns all automation IDs if no `automation_ids` are specified. + AutomationIds *[]string `json:"automation_ids,omitempty"` + // The number of elements you want returned on each page. + PageSize *int32 `json:"page_size,omitempty"` + // The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + PageToken *string `json:"page_token,omitempty"` +} + +func (params *ListAutomationStatParam) SetAutomationIds(AutomationIds []string) *ListAutomationStatParam { + params.AutomationIds = &AutomationIds + return params +} +func (params *ListAutomationStatParam) SetPageSize(PageSize int32) *ListAutomationStatParam { + params.PageSize = &PageSize + return params +} +func (params *ListAutomationStatParam) SetPageToken(PageToken string) *ListAutomationStatParam { + params.PageToken = &PageToken + return params +} + +// **This endpoint allows you to retrieve stats for all your Automations.** By default, all of your Automations will be returned, but you can specify a selection by passing in a comma-separated list of Automation IDs as the value of the query string parameter `automation_ids`. Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 25, but you can specify a value between 1 and 50. You can retrieve a specific page of responses with the `page_token` query string parameter. +func (c *ApiService) ListAutomationStat(params *ListAutomationStatParam) (interface{}, error) { + path := "/v3/marketing/stats/automations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.AutomationIds != nil { + for _, item := range *params.AutomationIds { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("automation_ids", string(v)) + + } + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AutomationsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_list_click_tracking_stat.go b/rest/api/v3/mc_stats/api_list_click_tracking_stat.go new file mode 100644 index 00000000..8f891cbc --- /dev/null +++ b/rest/api/v3/mc_stats/api_list_click_tracking_stat.go @@ -0,0 +1,133 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ListClickTrackingStatParam struct { + // The ID of the Automation you want to get click tracking stats for. + Id *string `json:"id"` + // Automations can have multiple steps. Including `step_id` as a `group_by` metric allows further granularity of stats. + GroupBy *[]Items `json:"group_by,omitempty"` + // Comma-separated list of `step_ids` that you want the link stats for. + StepIds *[]string `json:"step_ids,omitempty"` + // The number of elements you want returned on each page. + PageSize *int32 `json:"page_size,omitempty"` + // The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + PageToken *string `json:"page_token,omitempty"` +} + +func (params *ListClickTrackingStatParam) SetId(Id string) *ListClickTrackingStatParam { + params.Id = &Id + return params +} +func (params *ListClickTrackingStatParam) SetGroupBy(GroupBy []Items) *ListClickTrackingStatParam { + params.GroupBy = &GroupBy + return params +} +func (params *ListClickTrackingStatParam) SetStepIds(StepIds []string) *ListClickTrackingStatParam { + params.StepIds = &StepIds + return params +} +func (params *ListClickTrackingStatParam) SetPageSize(PageSize int32) *ListClickTrackingStatParam { + params.PageSize = &PageSize + return params +} +func (params *ListClickTrackingStatParam) SetPageToken(PageToken string) *ListClickTrackingStatParam { + params.PageToken = &PageToken + return params +} + +// **This endpoint lets you retrieve click-tracking stats for a single Automation**. The stats returned list the URLs embedded in your Automation and the number of clicks each one received. +func (c *ApiService) ListClickTrackingStat(params *ListClickTrackingStatParam) (interface{}, error) { + path := "/v3/marketing/stats/automations/{Id}/links" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.GroupBy != nil { + for _, item := range *params.GroupBy { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("group_by", string(v)) + + } + } + if params != nil && params.StepIds != nil { + for _, item := range *params.StepIds { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("step_ids", string(v)) + + } + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &AutmoationsLinkStatsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_list_single_send_stat.go b/rest/api/v3/mc_stats/api_list_single_send_stat.go new file mode 100644 index 00000000..70028d19 --- /dev/null +++ b/rest/api/v3/mc_stats/api_list_single_send_stat.go @@ -0,0 +1,96 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListSingleSendStatParam struct { + // This endpoint returns all Single Send IDs if no IDs are included in `singlesend_ids`. + SinglesendIds *[]string `json:"singlesend_ids,omitempty"` + // The number of elements you want returned on each page. + PageSize *int32 `json:"page_size,omitempty"` + // The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + PageToken *string `json:"page_token,omitempty"` +} + +func (params *ListSingleSendStatParam) SetSinglesendIds(SinglesendIds []string) *ListSingleSendStatParam { + params.SinglesendIds = &SinglesendIds + return params +} +func (params *ListSingleSendStatParam) SetPageSize(PageSize int32) *ListSingleSendStatParam { + params.PageSize = &PageSize + return params +} +func (params *ListSingleSendStatParam) SetPageToken(PageToken string) *ListSingleSendStatParam { + params.PageToken = &PageToken + return params +} + +// **This endpoint allows you to retrieve stats for all your Single Sends.** By default, all of your Single Sends will be returned, but you can specify a selection by passing in a comma-separated list of Single Send IDs as the value of the query string parameter `singlesend_ids`. Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 25, but you specify a value between 1 and 50. You can retrieve a specific page of responses with the `page_token` query string parameter. +func (c *ApiService) ListSingleSendStat(params *ListSingleSendStatParam) (interface{}, error) { + path := "/v3/marketing/stats/singlesends" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.SinglesendIds != nil { + for _, item := range *params.SinglesendIds { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("singlesend_ids", string(v)) + + } + } + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SinglesendsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_list_single_send_tracking_stat.go b/rest/api/v3/mc_stats/api_list_single_send_tracking_stat.go new file mode 100644 index 00000000..a0aca60f --- /dev/null +++ b/rest/api/v3/mc_stats/api_list_single_send_tracking_stat.go @@ -0,0 +1,133 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ListSingleSendTrackingStatParam struct { + // The ID of Single Send for which you want to retrieve link stats. + Id *string `json:"id"` + // The number of elements you want returned on each page. + PageSize *int32 `json:"page_size,omitempty"` + // The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + PageToken *string `json:"page_token,omitempty"` + // A/B Single Sends have multiple variation IDs and phase IDs. Including these additional fields allows further granularity of stats by these fields. + GroupBy *[]Items2 `json:"group_by,omitempty"` + // + AbVariationId *string `json:"ab_variation_id,omitempty"` + // + AbPhaseId *AbPhaseId `json:"ab_phase_id,omitempty"` +} + +func (params *ListSingleSendTrackingStatParam) SetId(Id string) *ListSingleSendTrackingStatParam { + params.Id = &Id + return params +} +func (params *ListSingleSendTrackingStatParam) SetPageSize(PageSize int32) *ListSingleSendTrackingStatParam { + params.PageSize = &PageSize + return params +} +func (params *ListSingleSendTrackingStatParam) SetPageToken(PageToken string) *ListSingleSendTrackingStatParam { + params.PageToken = &PageToken + return params +} +func (params *ListSingleSendTrackingStatParam) SetGroupBy(GroupBy []Items2) *ListSingleSendTrackingStatParam { + params.GroupBy = &GroupBy + return params +} +func (params *ListSingleSendTrackingStatParam) SetAbVariationId(AbVariationId string) *ListSingleSendTrackingStatParam { + params.AbVariationId = &AbVariationId + return params +} +func (params *ListSingleSendTrackingStatParam) SetAbPhaseId(AbPhaseId AbPhaseId) *ListSingleSendTrackingStatParam { + params.AbPhaseId = &AbPhaseId + return params +} + +// **This endpoint lets you retrieve click-tracking stats for one Single Send**. The stats returned list the URLs embedded in the specified Single Send and the number of clicks each one received. +func (c *ApiService) ListSingleSendTrackingStat(params *ListSingleSendTrackingStatParam) (interface{}, error) { + path := "/v3/marketing/stats/singlesends/{Id}/links" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + if params != nil && params.GroupBy != nil { + for _, item := range *params.GroupBy { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("group_by", string(v)) + + } + } + if params != nil && params.AbVariationId != nil { + data.Set("ab_variation_id", *params.AbVariationId) + } + if params != nil && params.AbPhaseId != nil { + data.Set("ab_phase_id", fmt.Sprint(*params.AbPhaseId)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SinglesendsLinkStatsResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_stats/api_service.go b/rest/api/v3/mc_stats/api_service.go new file mode 100644 index 00000000..913b3580 --- /dev/null +++ b/rest/api/v3/mc_stats/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_stats/docs/AbPhase.md b/rest/api/v3/mc_stats/docs/AbPhase.md new file mode 100644 index 00000000..db2402b9 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AbPhase.md @@ -0,0 +1,14 @@ +# AbPhase + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SEND** | string | (value: `"send"`) +**TEST** | string | (value: `"test"`) +**ALL** | string | (value: `"all"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/AbPhase1.md b/rest/api/v3/mc_stats/docs/AbPhase1.md new file mode 100644 index 00000000..2c5a9fdc --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AbPhase1.md @@ -0,0 +1,14 @@ +# AbPhase1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**SEND** | string | (value: `"send"`) +**TEST** | string | (value: `"test"`) +**ALL** | string | (value: `"all"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/AbPhaseId.md b/rest/api/v3/mc_stats/docs/AbPhaseId.md new file mode 100644 index 00000000..8ce3a5ed --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AbPhaseId.md @@ -0,0 +1,13 @@ +# AbPhaseId + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TEST** | string | (value: `"test"`) +**SEND** | string | (value: `"send"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/AggregatedBy.md b/rest/api/v3/mc_stats/docs/AggregatedBy.md new file mode 100644 index 00000000..5de3ca2f --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AggregatedBy.md @@ -0,0 +1,13 @@ +# AggregatedBy + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**TOTAL** | string | (value: `"total"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponse.md b/rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponse.md new file mode 100644 index 00000000..7efaf2f3 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponse.md @@ -0,0 +1,13 @@ +# AutmoationsLinkStatsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]AutmoationsLinkStatsResponseResultsInner**](AutmoationsLinkStatsResponseResultsInner.md) | | +**TotalClicks** | **int32** | | +**Metadata** | [**LinkTrackingMetadata**](LinkTrackingMetadata.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponseResultsInner.md b/rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponseResultsInner.md new file mode 100644 index 00000000..ba1436ce --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AutmoationsLinkStatsResponseResultsInner.md @@ -0,0 +1,14 @@ +# AutmoationsLinkStatsResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | This is the URL of the link clicked. If `{{custom_fields}}` are part of the URL, they will be included. | +**UrlLocation** | **int32** | This is the location of the link clicked in each Automation step. Links are located according to their position within the message; the topmost link has index `0`. |[optional] +**StepId** | **string** | This is the ID of the step if the stats were requested to be grouped by `step_id`. | +**Clicks** | **int32** | The number of clicks on this particular link. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/AutomationsResponse.md b/rest/api/v3/mc_stats/docs/AutomationsResponse.md new file mode 100644 index 00000000..856db55d --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AutomationsResponse.md @@ -0,0 +1,12 @@ +# AutomationsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]AutomationsResponseResultsInner**](AutomationsResponseResultsInner.md) | | +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/AutomationsResponseResultsInner.md b/rest/api/v3/mc_stats/docs/AutomationsResponseResultsInner.md new file mode 100644 index 00000000..204c3c2e --- /dev/null +++ b/rest/api/v3/mc_stats/docs/AutomationsResponseResultsInner.md @@ -0,0 +1,14 @@ +# AutomationsResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | This is the ID of the Automation you are requesting stats for. | +**Aggregation** | **string** | This describes the time unit to which the stat is rolled up. It is based on the `aggregated_by` parameter included in the request. It can be \"total\" or the date (in YYYY-MM-DD format) the stats are for. |[default to "total"] +**StepId** | **string** | This is the ID of the step if the stats were requested to be grouped by `step_id`. |[default to "all"] +**Stats** | [**Metrics**](Metrics.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/ErrorResponse.md b/rest/api/v3/mc_stats/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/ErrorResponseErrorsInner.md b/rest/api/v3/mc_stats/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/ExportAutomationStat.md b/rest/api/v3/mc_stats/docs/ExportAutomationStat.md new file mode 100644 index 00000000..71980e81 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ExportAutomationStat.md @@ -0,0 +1,49 @@ +# ExportAutomationStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ExportAutomationStat**](ExportAutomationStat.md#ExportAutomationStat) | **Get** /v3/marketing/stats/automations/export | Export Single Send Stats + + + +## ExportAutomationStat + +> string ExportAutomationStat(ctx, optional) + +Export Single Send Stats + +**This endpoint allows you to export Single Send stats as .CSV data**. You can specify one Single Send or many: include as many Single Send IDs as you need, separating them with commas, as the value of the `ids` query string parameter. The data is returned as plain text response but in .CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a .csv file. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ExportAutomationStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Ids** | **[]string** | The IDs of Single Sends for which to export stats. +**Timezone** | **string** | The [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented; i.e. `\"America/Chicago\"`. This parameter changes the timezone format only; it does not alter which stats are returned. + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/ExportSingleSendStat.md b/rest/api/v3/mc_stats/docs/ExportSingleSendStat.md new file mode 100644 index 00000000..e2a8a528 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ExportSingleSendStat.md @@ -0,0 +1,49 @@ +# ExportSingleSendStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ExportSingleSendStat**](ExportSingleSendStat.md#ExportSingleSendStat) | **Get** /v3/marketing/stats/singlesends/export | Export Single Send Stats + + + +## ExportSingleSendStat + +> string ExportSingleSendStat(ctx, optional) + +Export Single Send Stats + +**This endpoint allows you to export Single Send stats as .CSV data**. You can specify one Single Send or many: include as many Single Send IDs as you need, separating them with commas, as the value of the `ids` query string parameter. The data is returned as plain text response but in .CSV format, so your application making the call can present the information in whatever way is most appropriate, or just save the data as a .csv file. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ExportSingleSendStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Ids** | **[]string** | The IDs of Single Sends for which to export stats. +**Timezone** | **string** | The [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented; i.e. `\"America/Chicago\"`. This parameter changes the timezone format only; it does not alter which stats are returned. + +### Return type + +**string** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/GetAutomationStat.md b/rest/api/v3/mc_stats/docs/GetAutomationStat.md new file mode 100644 index 00000000..e97b64e5 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/GetAutomationStat.md @@ -0,0 +1,59 @@ +# GetAutomationStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetAutomationStat**](GetAutomationStat.md#GetAutomationStat) | **Get** /v3/marketing/stats/automations/{Id} | Get Automation Stats by ID + + + +## GetAutomationStat + +> AutomationsResponse GetAutomationStat(ctx, Idoptional) + +Get Automation Stats by ID + +**This endpoint allows you to retrieve stats for a single Automation using its ID.** Multiple Automation IDs can be retrieved using the \"Get All Automation Stats\" endpoint. Once you have an ID, this endpoint will return detailed stats for the single automation specified. You may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Automation for which you want to retrieve statistics. + +### Other Parameters + +Other parameters are passed through a pointer to a GetAutomationStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**GroupBy** | [**[]Items**](Items.md) | Automations can have multiple steps. Including `step_id` as a `group_by` metric allows further granularity of stats. +**StepIds** | **[]string** | Comma-separated list of `step_ids` that you want the link stats for. +**AggregatedBy** | [**AggregatedBy**](AggregatedByAggregatedBy.md) | Dictates how the stats are time-sliced. Currently, `\"total\"` and `\"day\"` are supported. +**StartDate** | **string** | Format: `YYYY-MM-DD`. If this parameter is included, the stats' start date is included in the search. +**EndDate** | **string** | Format: `YYYY-MM-DD`.If this parameter is included, the stats' end date is included in the search. +**Timezone** | **string** | [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented, e.g., \"America/Chicago\". +**PageSize** | **int32** | The number of elements you want returned on each page. +**PageToken** | **string** | The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + +### Return type + +[**AutomationsResponse**](AutomationsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/GetSingleSendStat.md b/rest/api/v3/mc_stats/docs/GetSingleSendStat.md new file mode 100644 index 00000000..59fa7e2c --- /dev/null +++ b/rest/api/v3/mc_stats/docs/GetSingleSendStat.md @@ -0,0 +1,58 @@ +# GetSingleSendStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSingleSendStat**](GetSingleSendStat.md#GetSingleSendStat) | **Get** /v3/marketing/stats/singlesends/{Id} | Get Single Send Stats by ID + + + +## GetSingleSendStat + +> SinglesendsResponse GetSingleSendStat(ctx, Idoptional) + +Get Single Send Stats by ID + +**This endpoint allows you to retrieve stats for an individual Single Send using a Single Send ID.** Multiple Single Send IDs can be retrieved using the \"Get All Single Sends Stats\" endpoint. Once you have an ID, this endpoint will return detailed stats for the Single Send specified. You may constrain the stats returned using the `start_date` and `end_date` query string parameters. You can also use the `group_by` and `aggregated_by` query string parameters to further refine the stats returned. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of Single Send for which you want to retrieve stats. + +### Other Parameters + +Other parameters are passed through a pointer to a GetSingleSendStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AggregatedBy** | [**AggregatedBy**](AggregatedByAggregatedBy.md) | Dictates how the stats are time-sliced. Currently, `\"total\"` and `\"day\"` are supported. +**StartDate** | **string** | Format: `YYYY-MM-DD`. If this parameter is included, the stats' start date is included in the search. +**EndDate** | **string** | Format: `YYYY-MM-DD`.If this parameter is included, the stats' end date is included in the search. +**Timezone** | **string** | [IANA Area/Region](https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones) string representing the timezone in which the stats are to be presented, e.g., \"America/Chicago\". +**PageSize** | **int32** | The number of elements you want returned on each page. +**PageToken** | **string** | The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. +**GroupBy** | [**[]Items1**](Items1.md) | A/B Single Sends have multiple variation IDs and phase IDs. Including these additional fields allows further granularity of stats by these fields. + +### Return type + +[**SinglesendsResponse**](SinglesendsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/Items.md b/rest/api/v3/mc_stats/docs/Items.md new file mode 100644 index 00000000..a670ab6d --- /dev/null +++ b/rest/api/v3/mc_stats/docs/Items.md @@ -0,0 +1,12 @@ +# Items + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**STEP_ID** | string | (value: `"step_id"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/Items1.md b/rest/api/v3/mc_stats/docs/Items1.md new file mode 100644 index 00000000..b9d5f118 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/Items1.md @@ -0,0 +1,13 @@ +# Items1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**VARIATION** | string | (value: `"ab_variation"`) +**PHASE** | string | (value: `"ab_phase"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/Items2.md b/rest/api/v3/mc_stats/docs/Items2.md new file mode 100644 index 00000000..5ef14d6d --- /dev/null +++ b/rest/api/v3/mc_stats/docs/Items2.md @@ -0,0 +1,13 @@ +# Items2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**VARIATION** | string | (value: `"ab_variation"`) +**PHASE** | string | (value: `"ab_phase"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/LinkTrackingMetadata.md b/rest/api/v3/mc_stats/docs/LinkTrackingMetadata.md new file mode 100644 index 00000000..200bf168 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/LinkTrackingMetadata.md @@ -0,0 +1,14 @@ +# LinkTrackingMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | The URL of the previous page of results. If this field isn't present, you're at the start of the list. |[optional] +**Self** | **string** | The URL of the current page of results. |[optional] +**Next** | **string** | The URL of the next page of results. If this field isn't present, you're at the end of the list. |[optional] +**Count** | **float32** | The number of items in the entire list, i.e., across all pages. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/ListAutomationStat.md b/rest/api/v3/mc_stats/docs/ListAutomationStat.md new file mode 100644 index 00000000..7bb19791 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ListAutomationStat.md @@ -0,0 +1,50 @@ +# ListAutomationStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAutomationStat**](ListAutomationStat.md#ListAutomationStat) | **Get** /v3/marketing/stats/automations | Get All Automation Stats + + + +## ListAutomationStat + +> AutomationsResponse ListAutomationStat(ctx, optional) + +Get All Automation Stats + +**This endpoint allows you to retrieve stats for all your Automations.** By default, all of your Automations will be returned, but you can specify a selection by passing in a comma-separated list of Automation IDs as the value of the query string parameter `automation_ids`. Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 25, but you can specify a value between 1 and 50. You can retrieve a specific page of responses with the `page_token` query string parameter. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAutomationStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AutomationIds** | **[]string** | This endpoint returns all automation IDs if no `automation_ids` are specified. +**PageSize** | **int32** | The number of elements you want returned on each page. +**PageToken** | **string** | The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + +### Return type + +[**AutomationsResponse**](AutomationsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/ListClickTrackingStat.md b/rest/api/v3/mc_stats/docs/ListClickTrackingStat.md new file mode 100644 index 00000000..48466b6f --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ListClickTrackingStat.md @@ -0,0 +1,55 @@ +# ListClickTrackingStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListClickTrackingStat**](ListClickTrackingStat.md#ListClickTrackingStat) | **Get** /v3/marketing/stats/automations/{Id}/links | Get Automation Click Tracking Stats by ID + + + +## ListClickTrackingStat + +> AutmoationsLinkStatsResponse ListClickTrackingStat(ctx, Idoptional) + +Get Automation Click Tracking Stats by ID + +**This endpoint lets you retrieve click-tracking stats for a single Automation**. The stats returned list the URLs embedded in your Automation and the number of clicks each one received. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Automation you want to get click tracking stats for. + +### Other Parameters + +Other parameters are passed through a pointer to a ListClickTrackingStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**GroupBy** | [**[]Items**](Items.md) | Automations can have multiple steps. Including `step_id` as a `group_by` metric allows further granularity of stats. +**StepIds** | **[]string** | Comma-separated list of `step_ids` that you want the link stats for. +**PageSize** | **int32** | The number of elements you want returned on each page. +**PageToken** | **string** | The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + +### Return type + +[**AutmoationsLinkStatsResponse**](AutmoationsLinkStatsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/ListSingleSendStat.md b/rest/api/v3/mc_stats/docs/ListSingleSendStat.md new file mode 100644 index 00000000..43d4841b --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ListSingleSendStat.md @@ -0,0 +1,50 @@ +# ListSingleSendStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSingleSendStat**](ListSingleSendStat.md#ListSingleSendStat) | **Get** /v3/marketing/stats/singlesends | Get All Single Sends Stats + + + +## ListSingleSendStat + +> SinglesendsResponse ListSingleSendStat(ctx, optional) + +Get All Single Sends Stats + +**This endpoint allows you to retrieve stats for all your Single Sends.** By default, all of your Single Sends will be returned, but you can specify a selection by passing in a comma-separated list of Single Send IDs as the value of the query string parameter `singlesend_ids`. Responses are paginated. You can limit the number of responses returned per batch using the `page_size` query string parameter. The default is 25, but you specify a value between 1 and 50. You can retrieve a specific page of responses with the `page_token` query string parameter. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSingleSendStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SinglesendIds** | **[]string** | This endpoint returns all Single Send IDs if no IDs are included in `singlesend_ids`. +**PageSize** | **int32** | The number of elements you want returned on each page. +**PageToken** | **string** | The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. + +### Return type + +[**SinglesendsResponse**](SinglesendsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/ListSingleSendTrackingStat.md b/rest/api/v3/mc_stats/docs/ListSingleSendTrackingStat.md new file mode 100644 index 00000000..8c831e70 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/ListSingleSendTrackingStat.md @@ -0,0 +1,56 @@ +# ListSingleSendTrackingStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSingleSendTrackingStat**](ListSingleSendTrackingStat.md#ListSingleSendTrackingStat) | **Get** /v3/marketing/stats/singlesends/{Id}/links | Get Single Send Click Tracking Stats by ID + + + +## ListSingleSendTrackingStat + +> SinglesendsLinkStatsResponse ListSingleSendTrackingStat(ctx, Idoptional) + +Get Single Send Click Tracking Stats by ID + +**This endpoint lets you retrieve click-tracking stats for one Single Send**. The stats returned list the URLs embedded in the specified Single Send and the number of clicks each one received. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of Single Send for which you want to retrieve link stats. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSingleSendTrackingStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PageSize** | **int32** | The number of elements you want returned on each page. +**PageToken** | **string** | The stats endpoints are paginated. To get the next page, call the passed `_metadata.next` URL. If `_metadata.prev` doesn't exist, you're at the first page. Similarly, if `_metadata.next` is not present, you're at the last page. +**GroupBy** | [**[]Items2**](Items2.md) | A/B Single Sends have multiple variation IDs and phase IDs. Including these additional fields allows further granularity of stats by these fields. +**AbVariationId** | **string** | +**AbPhaseId** | [**AbPhaseId**](AbPhaseIdAbPhaseId.md) | + +### Return type + +[**SinglesendsLinkStatsResponse**](SinglesendsLinkStatsResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_stats/docs/Metadata.md b/rest/api/v3/mc_stats/docs/Metadata.md new file mode 100644 index 00000000..79ca153c --- /dev/null +++ b/rest/api/v3/mc_stats/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | The URL of the previous page of results. If this field isn't present, you're at the start of the list. |[optional] +**Self** | **string** | The URL of the current page of results. |[optional] +**Next** | **string** | The URL of the next page of results. If this field isn't present, you're at the end of the list. |[optional] +**Count** | **float32** | The number of items in the entire list, i.e., across all pages. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/Metrics.md b/rest/api/v3/mc_stats/docs/Metrics.md new file mode 100644 index 00000000..029b2ac5 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/Metrics.md @@ -0,0 +1,22 @@ +# Metrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BounceDrops** | **int32** | | +**Bounces** | **int32** | | +**Clicks** | **int32** | | +**Delivered** | **int32** | | +**InvalidEmails** | **int32** | | +**Opens** | **int32** | | +**Requests** | **int32** | | +**SpamReportDrops** | **int32** | | +**SpamReports** | **int32** | | +**UniqueClicks** | **int32** | | +**UniqueOpens** | **int32** | | +**Unsubscribes** | **int32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponse.md b/rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponse.md new file mode 100644 index 00000000..e6d5eb4f --- /dev/null +++ b/rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponse.md @@ -0,0 +1,13 @@ +# SinglesendsLinkStatsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]SinglesendsLinkStatsResponseResultsInner**](SinglesendsLinkStatsResponseResultsInner.md) | This is the index of the link's location in the email contents. | +**Metadata** | [**LinkTrackingMetadata**](LinkTrackingMetadata.md) | | +**TotalClicks** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponseResultsInner.md b/rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponseResultsInner.md new file mode 100644 index 00000000..4d8176d8 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/SinglesendsLinkStatsResponseResultsInner.md @@ -0,0 +1,15 @@ +# SinglesendsLinkStatsResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | This is the URL of the link clicked. If `{{custom_fields}}` are part of the URL, they will be included. | +**UrlLocation** | **int32** | This is the location of the link clicked in each Single Send A/B variation, or in the Single Send itself if there are no variations. Links are numbered from the top down; the topmost link is index `0`. |[optional] +**AbVariation** | **string** | This is the A/B variation of the Single Send stat returned. It is set to `\"all\"` if the `ab_variation` query parameter was not set in the request and `group_by` doesn't contain `ab_variation`. | +**AbPhase** | [**AbPhase1**](AbPhase1.md) | This is the A/B phase of the Single Send stat returned. If the `ab_phase` query parameter was not provided, it will return `\"all\"`. | +**Clicks** | **int32** | the number of clicks on this particular link | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/SinglesendsResponse.md b/rest/api/v3/mc_stats/docs/SinglesendsResponse.md new file mode 100644 index 00000000..057df7b1 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/SinglesendsResponse.md @@ -0,0 +1,12 @@ +# SinglesendsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]SinglesendsResponseResultsInner**](SinglesendsResponseResultsInner.md) | | +**Metadata** | [**Metadata**](Metadata.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/docs/SinglesendsResponseResultsInner.md b/rest/api/v3/mc_stats/docs/SinglesendsResponseResultsInner.md new file mode 100644 index 00000000..319301d6 --- /dev/null +++ b/rest/api/v3/mc_stats/docs/SinglesendsResponseResultsInner.md @@ -0,0 +1,15 @@ +# SinglesendsResponseResultsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | This is the ID of the Single Send you require stats for. | +**AbVariation** | **string** | This is the A/B variation of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_variation` in the request, then the value is \"all\". |[default to "a14dcc63-d651-4c57-9826-4a3705f5c78d"] +**AbPhase** | [**AbPhase**](AbPhase.md) | This is the A/B phase of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_phase` in the request, then the value is \"all\". | +**Aggregation** | **string** | This describes the time unit to which the stat is rolled up. It is based on the `aggregated_by` parameter included in the request. It can be \"total\" or the date (in YYYY-MM-DD format) the stats are for. |[optional] [default to "total"] +**Stats** | [**Metrics**](Metrics.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_stats/model_ab_phase.go b/rest/api/v3/mc_stats/model_ab_phase.go new file mode 100644 index 00000000..4b242ec7 --- /dev/null +++ b/rest/api/v3/mc_stats/model_ab_phase.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AbPhase the model 'AbPhase' +type AbPhase string + +// List of AbPhase +const ( + ABPHASE_SEND AbPhase = "send" + ABPHASE_TEST AbPhase = "test" + ABPHASE_ALL AbPhase = "all" +) diff --git a/rest/api/v3/mc_stats/model_ab_phase1.go b/rest/api/v3/mc_stats/model_ab_phase1.go new file mode 100644 index 00000000..d2ead496 --- /dev/null +++ b/rest/api/v3/mc_stats/model_ab_phase1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AbPhase1 the model 'AbPhase1' +type AbPhase1 string + +// List of AbPhase1 +const ( + ABPHASE1_SEND AbPhase1 = "send" + ABPHASE1_TEST AbPhase1 = "test" + ABPHASE1_ALL AbPhase1 = "all" +) diff --git a/rest/api/v3/mc_stats/model_ab_phase_id.go b/rest/api/v3/mc_stats/model_ab_phase_id.go new file mode 100644 index 00000000..ef008051 --- /dev/null +++ b/rest/api/v3/mc_stats/model_ab_phase_id.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AbPhaseId the model 'AbPhaseId' +type AbPhaseId string + +// List of AbPhaseId +const ( + ABPHASEID_TEST AbPhaseId = "test" + ABPHASEID_SEND AbPhaseId = "send" +) diff --git a/rest/api/v3/mc_stats/model_aggregated_by.go b/rest/api/v3/mc_stats/model_aggregated_by.go new file mode 100644 index 00000000..9a5f47ea --- /dev/null +++ b/rest/api/v3/mc_stats/model_aggregated_by.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy the model 'AggregatedBy' +type AggregatedBy string + +// List of AggregatedBy +const ( + AGGREGATEDBY_DAY AggregatedBy = "day" + AGGREGATEDBY_TOTAL AggregatedBy = "total" +) diff --git a/rest/api/v3/mc_stats/model_autmoations_link_stats_response.go b/rest/api/v3/mc_stats/model_autmoations_link_stats_response.go new file mode 100644 index 00000000..eb0f0456 --- /dev/null +++ b/rest/api/v3/mc_stats/model_autmoations_link_stats_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AutmoationsLinkStatsResponse struct for AutmoationsLinkStatsResponse +type AutmoationsLinkStatsResponse struct { + // + Results []AutmoationsLinkStatsResponseResultsInner `json:"results"` + TotalClicks int32 `json:"total_clicks"` + Metadata LinkTrackingMetadata `json:"_metadata"` +} diff --git a/rest/api/v3/mc_stats/model_autmoations_link_stats_response_results_inner.go b/rest/api/v3/mc_stats/model_autmoations_link_stats_response_results_inner.go new file mode 100644 index 00000000..dd2efae5 --- /dev/null +++ b/rest/api/v3/mc_stats/model_autmoations_link_stats_response_results_inner.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AutmoationsLinkStatsResponseResultsInner struct for AutmoationsLinkStatsResponseResultsInner +type AutmoationsLinkStatsResponseResultsInner struct { + // This is the URL of the link clicked. If `{{custom_fields}}` are part of the URL, they will be included. + Url string `json:"url"` + // This is the location of the link clicked in each Automation step. Links are located according to their position within the message; the topmost link has index `0`. + UrlLocation *int32 `json:"url_location,omitempty"` + // This is the ID of the step if the stats were requested to be grouped by `step_id`. + StepId string `json:"step_id"` + // The number of clicks on this particular link. + Clicks int32 `json:"clicks"` +} diff --git a/rest/api/v3/mc_stats/model_automations_response.go b/rest/api/v3/mc_stats/model_automations_response.go new file mode 100644 index 00000000..6ac11cde --- /dev/null +++ b/rest/api/v3/mc_stats/model_automations_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AutomationsResponse struct for AutomationsResponse +type AutomationsResponse struct { + Results []AutomationsResponseResultsInner `json:"results"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/mc_stats/model_automations_response_results_inner.go b/rest/api/v3/mc_stats/model_automations_response_results_inner.go new file mode 100644 index 00000000..18bfe774 --- /dev/null +++ b/rest/api/v3/mc_stats/model_automations_response_results_inner.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AutomationsResponseResultsInner struct for AutomationsResponseResultsInner +type AutomationsResponseResultsInner struct { + // This is the ID of the Automation you are requesting stats for. + Id string `json:"id"` + // This describes the time unit to which the stat is rolled up. It is based on the `aggregated_by` parameter included in the request. It can be \"total\" or the date (in YYYY-MM-DD format) the stats are for. + Aggregation string `json:"aggregation"` + // This is the ID of the step if the stats were requested to be grouped by `step_id`. + StepId string `json:"step_id"` + Stats *Metrics `json:"stats,omitempty"` +} diff --git a/rest/api/v3/mc_stats/model_error_response.go b/rest/api/v3/mc_stats/model_error_response.go new file mode 100644 index 00000000..523ed1d3 --- /dev/null +++ b/rest/api/v3/mc_stats/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/mc_stats/model_error_response_errors_inner.go b/rest/api/v3/mc_stats/model_error_response_errors_inner.go new file mode 100644 index 00000000..7e65ce73 --- /dev/null +++ b/rest/api/v3/mc_stats/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/mc_stats/model_items.go b/rest/api/v3/mc_stats/model_items.go new file mode 100644 index 00000000..bc42ad0a --- /dev/null +++ b/rest/api/v3/mc_stats/model_items.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items the model 'Items' +type Items string + +// List of Items +const ( + ITEMS_STEP_ID Items = "step_id" +) diff --git a/rest/api/v3/mc_stats/model_items1.go b/rest/api/v3/mc_stats/model_items1.go new file mode 100644 index 00000000..7f1fba4f --- /dev/null +++ b/rest/api/v3/mc_stats/model_items1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items1 the model 'Items1' +type Items1 string + +// List of Items1 +const ( + ITEMS1_VARIATION Items1 = "ab_variation" + ITEMS1_PHASE Items1 = "ab_phase" +) diff --git a/rest/api/v3/mc_stats/model_items2.go b/rest/api/v3/mc_stats/model_items2.go new file mode 100644 index 00000000..686f84b8 --- /dev/null +++ b/rest/api/v3/mc_stats/model_items2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Items2 the model 'Items2' +type Items2 string + +// List of Items2 +const ( + ITEMS2_VARIATION Items2 = "ab_variation" + ITEMS2_PHASE Items2 = "ab_phase" +) diff --git a/rest/api/v3/mc_stats/model_link_tracking_metadata.go b/rest/api/v3/mc_stats/model_link_tracking_metadata.go new file mode 100644 index 00000000..e5ba7a4e --- /dev/null +++ b/rest/api/v3/mc_stats/model_link_tracking_metadata.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// LinkTrackingMetadata struct for LinkTrackingMetadata +type LinkTrackingMetadata struct { + // The URL of the previous page of results. If this field isn't present, you're at the start of the list. + Prev *string `json:"prev,omitempty"` + // The URL of the current page of results. + Self *string `json:"self,omitempty"` + // The URL of the next page of results. If this field isn't present, you're at the end of the list. + Next *string `json:"next,omitempty"` + // The number of items in the entire list, i.e., across all pages. + Count *float32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_stats/model_metadata.go b/rest/api/v3/mc_stats/model_metadata.go new file mode 100644 index 00000000..25cdeaa3 --- /dev/null +++ b/rest/api/v3/mc_stats/model_metadata.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + // The URL of the previous page of results. If this field isn't present, you're at the start of the list. + Prev *string `json:"prev,omitempty"` + // The URL of the current page of results. + Self *string `json:"self,omitempty"` + // The URL of the next page of results. If this field isn't present, you're at the end of the list. + Next *string `json:"next,omitempty"` + // The number of items in the entire list, i.e., across all pages. + Count *float32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/mc_stats/model_metrics.go b/rest/api/v3/mc_stats/model_metrics.go new file mode 100644 index 00000000..1242dc27 --- /dev/null +++ b/rest/api/v3/mc_stats/model_metrics.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metrics struct for Metrics +type Metrics struct { + BounceDrops int32 `json:"bounce_drops"` + Bounces int32 `json:"bounces"` + Clicks int32 `json:"clicks"` + Delivered int32 `json:"delivered"` + InvalidEmails int32 `json:"invalid_emails"` + Opens int32 `json:"opens"` + Requests int32 `json:"requests"` + SpamReportDrops int32 `json:"spam_report_drops"` + SpamReports int32 `json:"spam_reports"` + UniqueClicks int32 `json:"unique_clicks"` + UniqueOpens int32 `json:"unique_opens"` + Unsubscribes int32 `json:"unsubscribes"` +} diff --git a/rest/api/v3/mc_stats/model_singlesends_link_stats_response.go b/rest/api/v3/mc_stats/model_singlesends_link_stats_response.go new file mode 100644 index 00000000..a5c9989d --- /dev/null +++ b/rest/api/v3/mc_stats/model_singlesends_link_stats_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendsLinkStatsResponse struct for SinglesendsLinkStatsResponse +type SinglesendsLinkStatsResponse struct { + // This is the index of the link's location in the email contents. + Results []SinglesendsLinkStatsResponseResultsInner `json:"results"` + Metadata LinkTrackingMetadata `json:"_metadata"` + TotalClicks *int32 `json:"total_clicks,omitempty"` +} diff --git a/rest/api/v3/mc_stats/model_singlesends_link_stats_response_results_inner.go b/rest/api/v3/mc_stats/model_singlesends_link_stats_response_results_inner.go new file mode 100644 index 00000000..b07590ac --- /dev/null +++ b/rest/api/v3/mc_stats/model_singlesends_link_stats_response_results_inner.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendsLinkStatsResponseResultsInner struct for SinglesendsLinkStatsResponseResultsInner +type SinglesendsLinkStatsResponseResultsInner struct { + // This is the URL of the link clicked. If `{{custom_fields}}` are part of the URL, they will be included. + Url string `json:"url"` + // This is the location of the link clicked in each Single Send A/B variation, or in the Single Send itself if there are no variations. Links are numbered from the top down; the topmost link is index `0`. + UrlLocation *int32 `json:"url_location,omitempty"` + // This is the A/B variation of the Single Send stat returned. It is set to `\"all\"` if the `ab_variation` query parameter was not set in the request and `group_by` doesn't contain `ab_variation`. + AbVariation string `json:"ab_variation"` + // This is the A/B phase of the Single Send stat returned. If the `ab_phase` query parameter was not provided, it will return `\"all\"`. + AbPhase AbPhase1 `json:"ab_phase"` + // the number of clicks on this particular link + Clicks int32 `json:"clicks"` +} diff --git a/rest/api/v3/mc_stats/model_singlesends_response.go b/rest/api/v3/mc_stats/model_singlesends_response.go new file mode 100644 index 00000000..6dcecd1e --- /dev/null +++ b/rest/api/v3/mc_stats/model_singlesends_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendsResponse struct for SinglesendsResponse +type SinglesendsResponse struct { + Results []SinglesendsResponseResultsInner `json:"results"` + Metadata Metadata `json:"_metadata"` +} diff --git a/rest/api/v3/mc_stats/model_singlesends_response_results_inner.go b/rest/api/v3/mc_stats/model_singlesends_response_results_inner.go new file mode 100644 index 00000000..98b52187 --- /dev/null +++ b/rest/api/v3/mc_stats/model_singlesends_response_results_inner.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Statistics API +* The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the [Marketing Campaigns application user interface](https://mc.sendgrid.com/). This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the [Stats API](https://docs.sendgrid.com/api-reference/stats). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SinglesendsResponseResultsInner struct for SinglesendsResponseResultsInner +type SinglesendsResponseResultsInner struct { + // This is the ID of the Single Send you require stats for. + Id string `json:"id"` + // This is the A/B variation of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_variation` in the request, then the value is \"all\". + AbVariation string `json:"ab_variation"` + // This is the A/B phase of the Single Send stat returned. If the `group_by` parameter doesn't include `ab_phase` in the request, then the value is \"all\". + AbPhase AbPhase `json:"ab_phase"` + // This describes the time unit to which the stat is rolled up. It is based on the `aggregated_by` parameter included in the request. It can be \"total\" or the date (in YYYY-MM-DD format) the stats are for. + Aggregation *string `json:"aggregation,omitempty"` + Stats *Metrics `json:"stats,omitempty"` +} diff --git a/rest/api/v3/mc_test/README.md b/rest/api/v3/mc_test/README.md new file mode 100644 index 00000000..2bf6a68d --- /dev/null +++ b/rest/api/v3/mc_test/README.md @@ -0,0 +1,62 @@ +# Go API client for + +The Twilio SendGrid Test Email API allows you to test a marketing email by first sending it to a list of up to 10 email addresses before pushing to a contact list or segment. With this feature, you can test the layout and content of your message in multiple email clients and with multiple recipients to see how it will function in a real-world scenario. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.229382+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*SendTestMarketingEmail* | [**SendTestMarketingEmail**](docs/SendTestMarketingEmail.md#sendtestmarketingemail) | **Post** /v3/marketing/test/send_email | Send a Test Marketing Email + + +## Documentation For Models + + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [SendTestMarketingEmailRequest](SendTestMarketingEmailRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/mc_test/api_send_test_marketing_email.go b/rest/api/v3/mc_test/api_send_test_marketing_email.go new file mode 100644 index 00000000..a84adcc3 --- /dev/null +++ b/rest/api/v3/mc_test/api_send_test_marketing_email.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Send Test Email API +* The Twilio SendGrid Test Email API allows you to test a marketing email by first sending it to a list of up to 10 email addresses before pushing to a contact list or segment. With this feature, you can test the layout and content of your message in multiple email clients and with multiple recipients to see how it will function in a real-world scenario. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type SendTestMarketingEmailParam struct { + // + SendTestMarketingEmailRequest *SendTestMarketingEmailRequest `json:"SendTestMarketingEmailRequest,omitempty"` +} + +func (params *SendTestMarketingEmailParam) SetSendTestMarketingEmailRequest(SendTestMarketingEmailRequest SendTestMarketingEmailRequest) *SendTestMarketingEmailParam { + params.SendTestMarketingEmailRequest = &SendTestMarketingEmailRequest + return params +} + +// **This endpoint allows you to send a test marketing email to a list of email addresses**. Before sending a marketing message, you can test it using this endpoint. You may specify up to **10 contacts** in the `emails` request body field. You must also specify a `template_id` and include either a `from_address` or `sender_id`. You can manage your templates with the [Twilio SendGrid App](https://mc.sendgrid.com/dynamic-templates) or the [Transactional Templates API](https://docs.sendgrid.com/api-reference/transactional-templates). > Please note that this endpoint works with Dynamic Transactional Templates only. Legacy Transactional Templates will not be delivered. For more information about managing Dynamic Transactional Templates, see [How to Send Email with Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). You can also test your Single Sends in the [Twilio SendGrid Marketing Campaigns UI](https://mc.sendgrid.com/single-sends). +func (c *ApiService) SendTestMarketingEmail(params *SendTestMarketingEmailParam) (interface{}, error) { + path := "/v3/marketing/test/send_email" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SendTestMarketingEmailRequest != nil { + b, err := json.Marshal(*params.SendTestMarketingEmailRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/mc_test/api_service.go b/rest/api/v3/mc_test/api_service.go new file mode 100644 index 00000000..352104a5 --- /dev/null +++ b/rest/api/v3/mc_test/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Send Test Email API +* The Twilio SendGrid Test Email API allows you to test a marketing email by first sending it to a list of up to 10 email addresses before pushing to a contact list or segment. With this feature, you can test the layout and content of your message in multiple email clients and with multiple recipients to see how it will function in a real-world scenario. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/mc_test/docs/ErrorResponse.md b/rest/api/v3/mc_test/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/mc_test/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_test/docs/ErrorResponseErrorsInner.md b/rest/api/v3/mc_test/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/mc_test/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_test/docs/SendTestMarketingEmail.md b/rest/api/v3/mc_test/docs/SendTestMarketingEmail.md new file mode 100644 index 00000000..11a3daf9 --- /dev/null +++ b/rest/api/v3/mc_test/docs/SendTestMarketingEmail.md @@ -0,0 +1,48 @@ +# SendTestMarketingEmail + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SendTestMarketingEmail**](SendTestMarketingEmail.md#SendTestMarketingEmail) | **Post** /v3/marketing/test/send_email | Send a Test Marketing Email + + + +## SendTestMarketingEmail + +> map[string]interface{} SendTestMarketingEmail(ctx, optional) + +Send a Test Marketing Email + +**This endpoint allows you to send a test marketing email to a list of email addresses**. Before sending a marketing message, you can test it using this endpoint. You may specify up to **10 contacts** in the `emails` request body field. You must also specify a `template_id` and include either a `from_address` or `sender_id`. You can manage your templates with the [Twilio SendGrid App](https://mc.sendgrid.com/dynamic-templates) or the [Transactional Templates API](https://docs.sendgrid.com/api-reference/transactional-templates). > Please note that this endpoint works with Dynamic Transactional Templates only. Legacy Transactional Templates will not be delivered. For more information about managing Dynamic Transactional Templates, see [How to Send Email with Dynamic Transactional Templates](https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/). You can also test your Single Sends in the [Twilio SendGrid Marketing Campaigns UI](https://mc.sendgrid.com/single-sends). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a SendTestMarketingEmailParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SendTestMarketingEmailRequest** | [**SendTestMarketingEmailRequest**](SendTestMarketingEmailRequest.md) | + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/mc_test/docs/SendTestMarketingEmailRequest.md b/rest/api/v3/mc_test/docs/SendTestMarketingEmailRequest.md new file mode 100644 index 00000000..930d86ba --- /dev/null +++ b/rest/api/v3/mc_test/docs/SendTestMarketingEmailRequest.md @@ -0,0 +1,17 @@ +# SendTestMarketingEmailRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TemplateId** | **string** | The ID of the template that you would like to use. If you use a template that contains a subject and content (either text or HTML), then those values specified at the personalizations or message level will not be used. | +**VersionIdOverride** | **string** | You can override the active template with an alternative template version by passing the version ID in this field. If this field is blank, the active template version will be used. |[optional] +**SenderId** | **int32** | This ID must belong to a verified sender. Alternatively, you may supply a `from_address` email. |[optional] +**CustomUnsubscribeUrl** | **string** | A custom unsubscribe URL. |[optional] +**SuppressionGroupId** | **int32** | |[optional] +**Emails** | **[]string** | An array of email addresses you want to send the test message to. | +**FromAddress** | **string** | You can either specify this address or specify a verified sender ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/mc_test/model_error_response.go b/rest/api/v3/mc_test/model_error_response.go new file mode 100644 index 00000000..db9a301c --- /dev/null +++ b/rest/api/v3/mc_test/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Send Test Email API +* The Twilio SendGrid Test Email API allows you to test a marketing email by first sending it to a list of up to 10 email addresses before pushing to a contact list or segment. With this feature, you can test the layout and content of your message in multiple email clients and with multiple recipients to see how it will function in a real-world scenario. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/mc_test/model_error_response_errors_inner.go b/rest/api/v3/mc_test/model_error_response_errors_inner.go new file mode 100644 index 00000000..9c7eb834 --- /dev/null +++ b/rest/api/v3/mc_test/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Send Test Email API +* The Twilio SendGrid Test Email API allows you to test a marketing email by first sending it to a list of up to 10 email addresses before pushing to a contact list or segment. With this feature, you can test the layout and content of your message in multiple email clients and with multiple recipients to see how it will function in a real-world scenario. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/mc_test/model_send_test_marketing_email_request.go b/rest/api/v3/mc_test/model_send_test_marketing_email_request.go new file mode 100644 index 00000000..79bf2781 --- /dev/null +++ b/rest/api/v3/mc_test/model_send_test_marketing_email_request.go @@ -0,0 +1,31 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Marketing Campaigns Send Test Email API +* The Twilio SendGrid Test Email API allows you to test a marketing email by first sending it to a list of up to 10 email addresses before pushing to a contact list or segment. With this feature, you can test the layout and content of your message in multiple email clients and with multiple recipients to see how it will function in a real-world scenario. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SendTestMarketingEmailRequest struct for SendTestMarketingEmailRequest +type SendTestMarketingEmailRequest struct { + // The ID of the template that you would like to use. If you use a template that contains a subject and content (either text or HTML), then those values specified at the personalizations or message level will not be used. + TemplateId string `json:"template_id"` + // You can override the active template with an alternative template version by passing the version ID in this field. If this field is blank, the active template version will be used. + VersionIdOverride *string `json:"version_id_override,omitempty"` + // This ID must belong to a verified sender. Alternatively, you may supply a `from_address` email. + SenderId *int32 `json:"sender_id,omitempty"` + // A custom unsubscribe URL. + CustomUnsubscribeUrl *string `json:"custom_unsubscribe_url,omitempty"` + SuppressionGroupId *int32 `json:"suppression_group_id,omitempty"` + // An array of email addresses you want to send the test message to. + Emails []string `json:"emails"` + // You can either specify this address or specify a verified sender ID. + FromAddress *string `json:"from_address,omitempty"` +} diff --git a/rest/api/v3/partner/README.md b/rest/api/v3/partner/README.md new file mode 100644 index 00000000..2de743a8 --- /dev/null +++ b/rest/api/v3/partner/README.md @@ -0,0 +1,61 @@ +# Go API client for + +The Twilio SendGrid Partner Settings API allows you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners and how you can begin integrating with them, please visit our [Partners page](https://sendgrid.com/partners/marketplace/). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.288735+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ListPartnerSetting* | [**ListPartnerSetting**](docs/ListPartnerSetting.md#listpartnersetting) | **Get** /v3/partner_settings | Returns a list of all partner settings. + + +## Documentation For Models + + - [ListPartnerSetting200Response](ListPartnerSetting200Response.md) + - [ListPartnerSetting200ResponseResultInner](ListPartnerSetting200ResponseResultInner.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/partner/api_list_partner_setting.go b/rest/api/v3/partner/api_list_partner_setting.go new file mode 100644 index 00000000..31efe6d4 --- /dev/null +++ b/rest/api/v3/partner/api_list_partner_setting.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Partner API +* The Twilio SendGrid Partner Settings API allows you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners and how you can begin integrating with them, please visit our [Partners page](https://sendgrid.com/partners/marketplace/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListPartnerSettingParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListPartnerSettingParam) SetLimit(Limit int32) *ListPartnerSettingParam { + params.Limit = &Limit + return params +} +func (params *ListPartnerSettingParam) SetOffset(Offset int32) *ListPartnerSettingParam { + params.Offset = &Offset + return params +} +func (params *ListPartnerSettingParam) SetOnbehalfof(Onbehalfof string) *ListPartnerSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all partner settings that you can enable.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items.' +func (c *ApiService) ListPartnerSetting(params *ListPartnerSettingParam) (interface{}, error) { + path := "/v3/partner_settings" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListPartnerSetting200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/partner/api_service.go b/rest/api/v3/partner/api_service.go new file mode 100644 index 00000000..f4bf0ab0 --- /dev/null +++ b/rest/api/v3/partner/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Partner API +* The Twilio SendGrid Partner Settings API allows you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners and how you can begin integrating with them, please visit our [Partners page](https://sendgrid.com/partners/marketplace/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/partner/docs/ListPartnerSetting.md b/rest/api/v3/partner/docs/ListPartnerSetting.md new file mode 100644 index 00000000..c8a2675b --- /dev/null +++ b/rest/api/v3/partner/docs/ListPartnerSetting.md @@ -0,0 +1,50 @@ +# ListPartnerSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListPartnerSetting**](ListPartnerSetting.md#ListPartnerSetting) | **Get** /v3/partner_settings | Returns a list of all partner settings. + + + +## ListPartnerSetting + +> ListPartnerSetting200Response ListPartnerSetting(ctx, optional) + +Returns a list of all partner settings. + +**This endpoint allows you to retrieve a paginated list of all partner settings that you can enable.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items.' + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListPartnerSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListPartnerSetting200Response**](ListPartnerSetting200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/partner/docs/ListPartnerSetting200Response.md b/rest/api/v3/partner/docs/ListPartnerSetting200Response.md new file mode 100644 index 00000000..ab110ce2 --- /dev/null +++ b/rest/api/v3/partner/docs/ListPartnerSetting200Response.md @@ -0,0 +1,11 @@ +# ListPartnerSetting200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListPartnerSetting200ResponseResultInner**](ListPartnerSetting200ResponseResultInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/partner/docs/ListPartnerSetting200ResponseResultInner.md b/rest/api/v3/partner/docs/ListPartnerSetting200ResponseResultInner.md new file mode 100644 index 00000000..92854890 --- /dev/null +++ b/rest/api/v3/partner/docs/ListPartnerSetting200ResponseResultInner.md @@ -0,0 +1,14 @@ +# ListPartnerSetting200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | **string** | The title of the partner. | +**Enabled** | **bool** | Indicates if this partner setting has been enabled. | +**Name** | **string** | The name of the partner setting. | +**Description** | **string** | A description of this partner setting. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/partner/model_list_partner_setting_200_response.go b/rest/api/v3/partner/model_list_partner_setting_200_response.go new file mode 100644 index 00000000..f4ad199e --- /dev/null +++ b/rest/api/v3/partner/model_list_partner_setting_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Partner API +* The Twilio SendGrid Partner Settings API allows you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners and how you can begin integrating with them, please visit our [Partners page](https://sendgrid.com/partners/marketplace/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListPartnerSetting200Response struct for ListPartnerSetting200Response +type ListPartnerSetting200Response struct { + Result *[]ListPartnerSetting200ResponseResultInner `json:"result,omitempty"` +} diff --git a/rest/api/v3/partner/model_list_partner_setting_200_response_result_inner.go b/rest/api/v3/partner/model_list_partner_setting_200_response_result_inner.go new file mode 100644 index 00000000..7aa81206 --- /dev/null +++ b/rest/api/v3/partner/model_list_partner_setting_200_response_result_inner.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Partner API +* The Twilio SendGrid Partner Settings API allows you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners and how you can begin integrating with them, please visit our [Partners page](https://sendgrid.com/partners/marketplace/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListPartnerSetting200ResponseResultInner struct for ListPartnerSetting200ResponseResultInner +type ListPartnerSetting200ResponseResultInner struct { + // The title of the partner. + Title string `json:"title"` + // Indicates if this partner setting has been enabled. + Enabled bool `json:"enabled"` + // The name of the partner setting. + Name string `json:"name"` + // A description of this partner setting. + Description string `json:"description"` +} diff --git a/rest/api/v3/recipients_data_erasure/README.md b/rest/api/v3/recipients_data_erasure/README.md new file mode 100644 index 00000000..79de6829 --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/README.md @@ -0,0 +1,62 @@ +# Go API client for + +The Recipients' Data Erasure API allows Twilio SendGrid customers to delete their own customers' personal data from the Twilio SendGrid Platform. The use of this API facilitates the self-service removal of email personal data from the Twilio SendGrid platform and will enable customers to comply with various obligatory data privacy regulations. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.362527+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*EraseRecipientEmailData* | [**EraseRecipientEmailData**](docs/EraseRecipientEmailData.md#eraserecipientemaildata) | **Post** /v3/recipients/erasejob | Erase recipients' email data + + +## Documentation For Models + + - [RecipientsDataErasureEraseRecipientsRequest](RecipientsDataErasureEraseRecipientsRequest.md) + - [RecipientsDataErasureErrorV1](RecipientsDataErasureErrorV1.md) + - [RecipientsDataErasureJobId](RecipientsDataErasureJobId.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/recipients_data_erasure/api_erase_recipient_email_data.go b/rest/api/v3/recipients_data_erasure/api_erase_recipient_email_data.go new file mode 100644 index 00000000..a3394ef6 --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/api_erase_recipient_email_data.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Recipients' Data Erasure API +* The Recipients' Data Erasure API allows Twilio SendGrid customers to delete their own customers' personal data from the Twilio SendGrid Platform. The use of this API facilitates the self-service removal of email personal data from the Twilio SendGrid platform and will enable customers to comply with various obligatory data privacy regulations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type EraseRecipientEmailDataParam struct { + // + RecipientsDataErasureEraseRecipientsRequest *RecipientsDataErasureEraseRecipientsRequest `json:"RecipientsDataErasureEraseRecipientsRequest"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *EraseRecipientEmailDataParam) SetRecipientsDataErasureEraseRecipientsRequest(RecipientsDataErasureEraseRecipientsRequest RecipientsDataErasureEraseRecipientsRequest) *EraseRecipientEmailDataParam { + params.RecipientsDataErasureEraseRecipientsRequest = &RecipientsDataErasureEraseRecipientsRequest + return params +} +func (params *EraseRecipientEmailDataParam) SetOnbehalfof(Onbehalfof string) *EraseRecipientEmailDataParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This operation allows you to delete your recipients' personal email data** The Delete Recipients' Email Data operation accepts a list of 5,000 `email_addresses` or a total payload size of 256Kb per request, whichever comes first. Upon a successful request with this operation, SendGrid will run a search on the email addresses provided against the SendGrid system to identify matches. SendGrid will then delete all personal data associated with the matched users such as the recipients' names, email addresses, subject lines, categories, and IP addresses. All email addresses are filtered for uniqueness and tested for structural validity—any invalid addresses will be returned in an error response. Please note that recipient data is deleted for the account making the request only—deletions do not cascade from a parent account to its Subusers' recipients. To delete a Subuser's recipients' data, you can use the `on-behalf-of` header. +func (c *ApiService) EraseRecipientEmailData(params *EraseRecipientEmailDataParam) (interface{}, error) { + path := "/v3/recipients/erasejob" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.RecipientsDataErasureEraseRecipientsRequest != nil { + b, err := json.Marshal(*params.RecipientsDataErasureEraseRecipientsRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 202 { + ps := &RecipientsDataErasureJobId{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/recipients_data_erasure/api_service.go b/rest/api/v3/recipients_data_erasure/api_service.go new file mode 100644 index 00000000..b823caa4 --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Recipients' Data Erasure API +* The Recipients' Data Erasure API allows Twilio SendGrid customers to delete their own customers' personal data from the Twilio SendGrid Platform. The use of this API facilitates the self-service removal of email personal data from the Twilio SendGrid platform and will enable customers to comply with various obligatory data privacy regulations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/recipients_data_erasure/docs/EraseRecipientEmailData.md b/rest/api/v3/recipients_data_erasure/docs/EraseRecipientEmailData.md new file mode 100644 index 00000000..ef961a3d --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/docs/EraseRecipientEmailData.md @@ -0,0 +1,48 @@ +# EraseRecipientEmailData + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**EraseRecipientEmailData**](EraseRecipientEmailData.md#EraseRecipientEmailData) | **Post** /v3/recipients/erasejob | Erase recipients' email data + + + +## EraseRecipientEmailData + +> RecipientsDataErasureJobId EraseRecipientEmailData(ctx, RecipientsDataErasureEraseRecipientsRequestoptional) + +Erase recipients' email data + +**This operation allows you to delete your recipients' personal email data** The Delete Recipients' Email Data operation accepts a list of 5,000 `email_addresses` or a total payload size of 256Kb per request, whichever comes first. Upon a successful request with this operation, SendGrid will run a search on the email addresses provided against the SendGrid system to identify matches. SendGrid will then delete all personal data associated with the matched users such as the recipients' names, email addresses, subject lines, categories, and IP addresses. All email addresses are filtered for uniqueness and tested for structural validity—any invalid addresses will be returned in an error response. Please note that recipient data is deleted for the account making the request only—deletions do not cascade from a parent account to its Subusers' recipients. To delete a Subuser's recipients' data, you can use the `on-behalf-of` header. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a EraseRecipientEmailDataParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**RecipientsDataErasureJobId**](RecipientsDataErasureJobId.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureEraseRecipientsRequest.md b/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureEraseRecipientsRequest.md new file mode 100644 index 00000000..fed050d6 --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureEraseRecipientsRequest.md @@ -0,0 +1,11 @@ +# RecipientsDataErasureEraseRecipientsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EmailAddresses** | **[]string** | List of unique recipient email addresses whose PII will be erased. You may include a maximum of 5,000 addresses or a maximum payload size of 256Kb, whichever comes first. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureErrorV1.md b/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureErrorV1.md new file mode 100644 index 00000000..2f32e4f2 --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureErrorV1.md @@ -0,0 +1,12 @@ +# RecipientsDataErasureErrorV1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The message representing the error from the API | +**Field** | **string** | The field associated with the error | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureJobId.md b/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureJobId.md new file mode 100644 index 00000000..6e21073b --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/docs/RecipientsDataErasureJobId.md @@ -0,0 +1,11 @@ +# RecipientsDataErasureJobId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JobId** | **string** | The job ID associated with the data erasure request. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_erase_recipients_request.go b/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_erase_recipients_request.go new file mode 100644 index 00000000..d2ce724b --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_erase_recipients_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Recipients' Data Erasure API +* The Recipients' Data Erasure API allows Twilio SendGrid customers to delete their own customers' personal data from the Twilio SendGrid Platform. The use of this API facilitates the self-service removal of email personal data from the Twilio SendGrid platform and will enable customers to comply with various obligatory data privacy regulations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// RecipientsDataErasureEraseRecipientsRequest struct for RecipientsDataErasureEraseRecipientsRequest +type RecipientsDataErasureEraseRecipientsRequest struct { + // List of unique recipient email addresses whose PII will be erased. You may include a maximum of 5,000 addresses or a maximum payload size of 256Kb, whichever comes first. + EmailAddresses []string `json:"email_addresses"` +} diff --git a/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_error_v1.go b/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_error_v1.go new file mode 100644 index 00000000..80864193 --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_error_v1.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Recipients' Data Erasure API +* The Recipients' Data Erasure API allows Twilio SendGrid customers to delete their own customers' personal data from the Twilio SendGrid Platform. The use of this API facilitates the self-service removal of email personal data from the Twilio SendGrid platform and will enable customers to comply with various obligatory data privacy regulations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// RecipientsDataErasureErrorV1 struct for RecipientsDataErasureErrorV1 +type RecipientsDataErasureErrorV1 struct { + // The message representing the error from the API + Message string `json:"message"` + // The field associated with the error + Field string `json:"field"` +} diff --git a/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_job_id.go b/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_job_id.go new file mode 100644 index 00000000..c8a68be1 --- /dev/null +++ b/rest/api/v3/recipients_data_erasure/model_recipients_data_erasure_job_id.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Recipients' Data Erasure API +* The Recipients' Data Erasure API allows Twilio SendGrid customers to delete their own customers' personal data from the Twilio SendGrid Platform. The use of this API facilitates the self-service removal of email personal data from the Twilio SendGrid platform and will enable customers to comply with various obligatory data privacy regulations. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// RecipientsDataErasureJobId struct for RecipientsDataErasureJobId +type RecipientsDataErasureJobId struct { + // The job ID associated with the data erasure request. + JobId string `json:"job_id"` +} diff --git a/rest/api/v3/reverse_dns/README.md b/rest/api/v3/reverse_dns/README.md new file mode 100644 index 00000000..d3767ab4 --- /dev/null +++ b/rest/api/v3/reverse_dns/README.md @@ -0,0 +1,84 @@ +# Go API client for + +The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. + +When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. + +Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. + +You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). + +See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.347891+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DeleteReverseDns* | [**DeleteReverseDns**](docs/DeleteReverseDns.md#deletereversedns) | **Delete** /v3/whitelabel/ips/{Id} | Delete a reverse DNS record +*GetReverseDns* | [**GetReverseDns**](docs/GetReverseDns.md#getreversedns) | **Get** /v3/whitelabel/ips/{Id} | Retrieve a reverse DNS record +*ListReverseDns* | [**ListReverseDns**](docs/ListReverseDns.md#listreversedns) | **Get** /v3/whitelabel/ips | Retrieve all reverse DNS records +*SetUpReverseDns* | [**SetUpReverseDns**](docs/SetUpReverseDns.md#setupreversedns) | **Post** /v3/whitelabel/ips | Set up reverse DNS +*ValidateReverseDns* | [**ValidateReverseDns**](docs/ValidateReverseDns.md#validatereversedns) | **Post** /v3/whitelabel/ips/{Id}/validate | Validate a reverse DNS record + + +## Documentation For Models + + - [ReverseDns](ReverseDns.md) + - [ReverseDnsARecord](ReverseDnsARecord.md) + - [ReverseDnsUsersInner](ReverseDnsUsersInner.md) + - [SetUpReverseDnsRequest](SetUpReverseDnsRequest.md) + - [Valid](Valid.md) + - [Valid1](Valid1.md) + - [ValidateReverseDns200Response](ValidateReverseDns200Response.md) + - [ValidateReverseDns200ResponseValidationResults](ValidateReverseDns200ResponseValidationResults.md) + - [ValidateReverseDns200ResponseValidationResultsARecord](ValidateReverseDns200ResponseValidationResultsARecord.md) + - [ValidateReverseDns404Response](ValidateReverseDns404Response.md) + - [ValidateReverseDns404ResponseErrorsInner](ValidateReverseDns404ResponseErrorsInner.md) + - [ValidateReverseDns500Response](ValidateReverseDns500Response.md) + - [ValidateReverseDns500ResponseErrorsInner](ValidateReverseDns500ResponseErrorsInner.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/reverse_dns/api_delete_reverse_dns.go b/rest/api/v3/reverse_dns/api_delete_reverse_dns.go new file mode 100644 index 00000000..9d41024c --- /dev/null +++ b/rest/api/v3/reverse_dns/api_delete_reverse_dns.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteReverseDnsParam struct { + // The ID of the reverse DNS record that you would like to retrieve. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteReverseDnsParam) SetId(Id string) *DeleteReverseDnsParam { + params.Id = &Id + return params +} +func (params *DeleteReverseDnsParam) SetOnbehalfof(Onbehalfof string) *DeleteReverseDnsParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a reverse DNS record.** A call to this endpoint will respond with a 204 status code if the deletion was successful. You can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint. +func (c *ApiService) DeleteReverseDns(params *DeleteReverseDnsParam) (interface{}, error) { + path := "/v3/whitelabel/ips/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/reverse_dns/api_get_reverse_dns.go b/rest/api/v3/reverse_dns/api_get_reverse_dns.go new file mode 100644 index 00000000..d93067b1 --- /dev/null +++ b/rest/api/v3/reverse_dns/api_get_reverse_dns.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetReverseDnsParam struct { + // The ID of the reverse DNS record that you would like to retrieve. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetReverseDnsParam) SetId(Id string) *GetReverseDnsParam { + params.Id = &Id + return params +} +func (params *GetReverseDnsParam) SetOnbehalfof(Onbehalfof string) *GetReverseDnsParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a reverse DNS record.** You can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint. +func (c *ApiService) GetReverseDns(params *GetReverseDnsParam) (interface{}, error) { + path := "/v3/whitelabel/ips/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ReverseDns{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/reverse_dns/api_list_reverse_dns.go b/rest/api/v3/reverse_dns/api_list_reverse_dns.go new file mode 100644 index 00000000..4eb8b76c --- /dev/null +++ b/rest/api/v3/reverse_dns/api_list_reverse_dns.go @@ -0,0 +1,88 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListReverseDnsParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The IP address segment that you'd like to use in a prefix search. + Ip *string `json:"ip,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListReverseDnsParam) SetLimit(Limit int32) *ListReverseDnsParam { + params.Limit = &Limit + return params +} +func (params *ListReverseDnsParam) SetOffset(Offset int32) *ListReverseDnsParam { + params.Offset = &Offset + return params +} +func (params *ListReverseDnsParam) SetIp(Ip string) *ListReverseDnsParam { + params.Ip = &Ip + return params +} +func (params *ListReverseDnsParam) SetOnbehalfof(Onbehalfof string) *ListReverseDnsParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all the Reverse DNS records created by this account.** You may include a search key by using the `ip` query string parameter. This enables you to perform a prefix search for a given IP segment (e.g., `?ip=\"192.\"`). You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListReverseDns(params *ListReverseDnsParam) (interface{}, error) { + path := "/v3/whitelabel/ips" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.Ip != nil { + data.Set("ip", *params.Ip) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ReverseDns{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/reverse_dns/api_service.go b/rest/api/v3/reverse_dns/api_service.go new file mode 100644 index 00000000..6e1bfe2b --- /dev/null +++ b/rest/api/v3/reverse_dns/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/reverse_dns/api_set_up_reverse_dns.go b/rest/api/v3/reverse_dns/api_set_up_reverse_dns.go new file mode 100644 index 00000000..6bf9ea86 --- /dev/null +++ b/rest/api/v3/reverse_dns/api_set_up_reverse_dns.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type SetUpReverseDnsParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + SetUpReverseDnsRequest *SetUpReverseDnsRequest `json:"SetUpReverseDnsRequest,omitempty"` +} + +func (params *SetUpReverseDnsParam) SetOnbehalfof(Onbehalfof string) *SetUpReverseDnsParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *SetUpReverseDnsParam) SetSetUpReverseDnsRequest(SetUpReverseDnsRequest SetUpReverseDnsRequest) *SetUpReverseDnsParam { + params.SetUpReverseDnsRequest = &SetUpReverseDnsRequest + return params +} + +// **This endpoint allows you to set up reverse DNS.** +func (c *ApiService) SetUpReverseDns(params *SetUpReverseDnsParam) (interface{}, error) { + path := "/v3/whitelabel/ips" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SetUpReverseDnsRequest != nil { + b, err := json.Marshal(*params.SetUpReverseDnsRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ReverseDns{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/reverse_dns/api_validate_reverse_dns.go b/rest/api/v3/reverse_dns/api_validate_reverse_dns.go new file mode 100644 index 00000000..a9721489 --- /dev/null +++ b/rest/api/v3/reverse_dns/api_validate_reverse_dns.go @@ -0,0 +1,86 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ValidateReverseDnsParam struct { + // The ID of the reverse DNS record that you would like to validate. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ValidateReverseDnsParam) SetId(Id string) *ValidateReverseDnsParam { + params.Id = &Id + return params +} +func (params *ValidateReverseDnsParam) SetOnbehalfof(Onbehalfof string) *ValidateReverseDnsParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to validate a reverse DNS record.** Always check the `valid` property of the response’s `validation_results.a_record` object. This field will indicate whether it was possible to validate the reverse DNS record. If the `validation_results.a_record.valid` is `false`, this indicates only that Twilio SendGrid could not determine the validity your reverse DNS record — it may still be valid. If validity couldn’t be determined, you can check the value of `validation_results.a_record.reason` to find out why. You can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint. +func (c *ApiService) ValidateReverseDns(params *ValidateReverseDnsParam) (interface{}, error) { + path := "/v3/whitelabel/ips/{Id}/validate" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ValidateReverseDns200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ValidateReverseDns404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ValidateReverseDns500Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/reverse_dns/docs/DeleteReverseDns.md b/rest/api/v3/reverse_dns/docs/DeleteReverseDns.md new file mode 100644 index 00000000..13f51043 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/DeleteReverseDns.md @@ -0,0 +1,52 @@ +# DeleteReverseDns + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteReverseDns**](DeleteReverseDns.md#DeleteReverseDns) | **Delete** /v3/whitelabel/ips/{Id} | Delete a reverse DNS record + + + +## DeleteReverseDns + +> map[string]interface{} DeleteReverseDns(ctx, Idoptional) + +Delete a reverse DNS record + +**This endpoint allows you to delete a reverse DNS record.** A call to this endpoint will respond with a 204 status code if the deletion was successful. You can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the reverse DNS record that you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteReverseDnsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/reverse_dns/docs/GetReverseDns.md b/rest/api/v3/reverse_dns/docs/GetReverseDns.md new file mode 100644 index 00000000..c54a9054 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/GetReverseDns.md @@ -0,0 +1,52 @@ +# GetReverseDns + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetReverseDns**](GetReverseDns.md#GetReverseDns) | **Get** /v3/whitelabel/ips/{Id} | Retrieve a reverse DNS record + + + +## GetReverseDns + +> ReverseDns GetReverseDns(ctx, Idoptional) + +Retrieve a reverse DNS record + +**This endpoint allows you to retrieve a reverse DNS record.** You can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the reverse DNS record that you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetReverseDnsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ReverseDns**](ReverseDns.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/reverse_dns/docs/ListReverseDns.md b/rest/api/v3/reverse_dns/docs/ListReverseDns.md new file mode 100644 index 00000000..28c28b73 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ListReverseDns.md @@ -0,0 +1,51 @@ +# ListReverseDns + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListReverseDns**](ListReverseDns.md#ListReverseDns) | **Get** /v3/whitelabel/ips | Retrieve all reverse DNS records + + + +## ListReverseDns + +> []ReverseDns ListReverseDns(ctx, optional) + +Retrieve all reverse DNS records + +**This endpoint allows you to retrieve a paginated list of all the Reverse DNS records created by this account.** You may include a search key by using the `ip` query string parameter. This enables you to perform a prefix search for a given IP segment (e.g., `?ip=\"192.\"`). You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListReverseDnsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Ip** | **string** | The IP address segment that you'd like to use in a prefix search. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]ReverseDns**](ReverseDns.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/reverse_dns/docs/ReverseDns.md b/rest/api/v3/reverse_dns/docs/ReverseDns.md new file mode 100644 index 00000000..0e3e4d96 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ReverseDns.md @@ -0,0 +1,20 @@ +# ReverseDns + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the Reverse DNS. | +**Ip** | **string** | The IP address that this Reverse DNS was created for. | +**Rdns** | **string** | The reverse DNS record for the IP address. This points to the Reverse DNS subdomain. | +**Users** | [**[]ReverseDnsUsersInner**](ReverseDnsUsersInner.md) | The users who are able to send mail from the IP address. | +**Subdomain** | **string** | The subdomain created for this reverse DNS. This is where the rDNS record points. |[optional] +**Domain** | **string** | The root, or sending, domain. | +**Valid** | **bool** | Indicates if this is a valid Reverse DNS. | +**Legacy** | **bool** | Indicates if this Reverse DNS was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new Reverse DNS if you need to update it. | +**LastValidationAttemptAt** | **int32** | A Unix epoch timestamp representing the last time of a validation attempt. |[optional] +**ARecord** | [**ReverseDnsARecord**](ReverseDnsARecord.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ReverseDnsARecord.md b/rest/api/v3/reverse_dns/docs/ReverseDnsARecord.md new file mode 100644 index 00000000..e0c2fb73 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ReverseDnsARecord.md @@ -0,0 +1,14 @@ +# ReverseDnsARecord + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | **bool** | Indicates if the a_record is valid. | +**Type** | **string** | The type of DNS record. | +**Host** | **string** | This is the web address that will be mapped to the IP address. | +**Data** | **string** | The IP address being set up with Reverse DNS. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ReverseDnsUsersInner.md b/rest/api/v3/reverse_dns/docs/ReverseDnsUsersInner.md new file mode 100644 index 00000000..f28c8202 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ReverseDnsUsersInner.md @@ -0,0 +1,12 @@ +# ReverseDnsUsersInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | The username of a user who can send mail from the IP address. | +**UserId** | **int32** | The ID of a user who can send mail from the IP address. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/SetUpReverseDns.md b/rest/api/v3/reverse_dns/docs/SetUpReverseDns.md new file mode 100644 index 00000000..dbf9cdd7 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/SetUpReverseDns.md @@ -0,0 +1,49 @@ +# SetUpReverseDns + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SetUpReverseDns**](SetUpReverseDns.md#SetUpReverseDns) | **Post** /v3/whitelabel/ips | Set up reverse DNS + + + +## SetUpReverseDns + +> ReverseDns SetUpReverseDns(ctx, optional) + +Set up reverse DNS + +**This endpoint allows you to set up reverse DNS.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a SetUpReverseDnsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**SetUpReverseDnsRequest** | [**SetUpReverseDnsRequest**](SetUpReverseDnsRequest.md) | + +### Return type + +[**ReverseDns**](ReverseDns.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/reverse_dns/docs/SetUpReverseDnsRequest.md b/rest/api/v3/reverse_dns/docs/SetUpReverseDnsRequest.md new file mode 100644 index 00000000..c0e04d6b --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/SetUpReverseDnsRequest.md @@ -0,0 +1,13 @@ +# SetUpReverseDnsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ip** | **string** | The IP address for which you want to set up reverse DNS. | +**Subdomain** | **string** | The subdomain that will be used to send emails from the IP address. This should be the same as the subdomain used to set up an authenticated domain. |[optional] +**Domain** | **string** | The root, or sending, domain that will be used to send message from the IP address. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/Valid.md b/rest/api/v3/reverse_dns/docs/Valid.md new file mode 100644 index 00000000..2addd0e7 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/Valid.md @@ -0,0 +1,13 @@ +# Valid + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/Valid1.md b/rest/api/v3/reverse_dns/docs/Valid1.md new file mode 100644 index 00000000..bca4d56b --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/Valid1.md @@ -0,0 +1,13 @@ +# Valid1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**TRUE** | bool | (value: `true`) +**FALSE** | bool | (value: `false`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns.md new file mode 100644 index 00000000..fa170b18 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns.md @@ -0,0 +1,52 @@ +# ValidateReverseDns + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ValidateReverseDns**](ValidateReverseDns.md#ValidateReverseDns) | **Post** /v3/whitelabel/ips/{Id}/validate | Validate a reverse DNS record + + + +## ValidateReverseDns + +> ValidateReverseDns200Response ValidateReverseDns(ctx, Idoptional) + +Validate a reverse DNS record + +**This endpoint allows you to validate a reverse DNS record.** Always check the `valid` property of the response’s `validation_results.a_record` object. This field will indicate whether it was possible to validate the reverse DNS record. If the `validation_results.a_record.valid` is `false`, this indicates only that Twilio SendGrid could not determine the validity your reverse DNS record — it may still be valid. If validity couldn’t be determined, you can check the value of `validation_results.a_record.reason` to find out why. You can retrieve the IDs associated with all your reverse DNS records using the \"Retrieve all reverse DNS records\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the reverse DNS record that you would like to validate. + +### Other Parameters + +Other parameters are passed through a pointer to a ValidateReverseDnsParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ValidateReverseDns200Response**](ValidateReverseDns200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns200Response.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns200Response.md new file mode 100644 index 00000000..5ca8da4c --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns200Response.md @@ -0,0 +1,13 @@ +# ValidateReverseDns200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of the reverse DNS record. | +**Valid** | [**Valid**](Valid.md) | Indicates if the reverse DNS record is valid. | +**ValidationResults** | [**ValidateReverseDns200ResponseValidationResults**](ValidateReverseDns200ResponseValidationResults.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResults.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResults.md new file mode 100644 index 00000000..4cb2f1ed --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResults.md @@ -0,0 +1,11 @@ +# ValidateReverseDns200ResponseValidationResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ARecord** | [**ValidateReverseDns200ResponseValidationResultsARecord**](ValidateReverseDns200ResponseValidationResultsARecord.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResultsARecord.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResultsARecord.md new file mode 100644 index 00000000..4ed45863 --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns200ResponseValidationResultsARecord.md @@ -0,0 +1,12 @@ +# ValidateReverseDns200ResponseValidationResultsARecord + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Valid** | [**Valid1**](Valid1.md) | Indicates if the reverse DNS record could be validated. | +**Reason** | **string** | The reason the reverse DNS record could not be validated. Is `null` if the reverse DNS record was validated. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns404Response.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns404Response.md new file mode 100644 index 00000000..18de5e6c --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns404Response.md @@ -0,0 +1,11 @@ +# ValidateReverseDns404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ValidateReverseDns404ResponseErrorsInner**](ValidateReverseDns404ResponseErrorsInner.md) | The error messages for the failed validation. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns404ResponseErrorsInner.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns404ResponseErrorsInner.md new file mode 100644 index 00000000..ec8b260a --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns404ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# ValidateReverseDns404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | A message describing why the reverse DNS could not be validated. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns500Response.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns500Response.md new file mode 100644 index 00000000..62f027dc --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns500Response.md @@ -0,0 +1,11 @@ +# ValidateReverseDns500Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ValidateReverseDns500ResponseErrorsInner**](ValidateReverseDns500ResponseErrorsInner.md) | The error messages for the failed validation. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/docs/ValidateReverseDns500ResponseErrorsInner.md b/rest/api/v3/reverse_dns/docs/ValidateReverseDns500ResponseErrorsInner.md new file mode 100644 index 00000000..214fa0ca --- /dev/null +++ b/rest/api/v3/reverse_dns/docs/ValidateReverseDns500ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# ValidateReverseDns500ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | A message describing why the IP whitelabel could not be validated. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/reverse_dns/model_reverse_dns.go b/rest/api/v3/reverse_dns/model_reverse_dns.go new file mode 100644 index 00000000..7c91cd7f --- /dev/null +++ b/rest/api/v3/reverse_dns/model_reverse_dns.go @@ -0,0 +1,37 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ReverseDns struct for ReverseDns +type ReverseDns struct { + // The ID of the Reverse DNS. + Id int32 `json:"id"` + // The IP address that this Reverse DNS was created for. + Ip string `json:"ip"` + // The reverse DNS record for the IP address. This points to the Reverse DNS subdomain. + Rdns string `json:"rdns"` + // The users who are able to send mail from the IP address. + Users []ReverseDnsUsersInner `json:"users"` + // The subdomain created for this reverse DNS. This is where the rDNS record points. + Subdomain *string `json:"subdomain,omitempty"` + // The root, or sending, domain. + Domain string `json:"domain"` + // Indicates if this is a valid Reverse DNS. + Valid bool `json:"valid"` + // Indicates if this Reverse DNS was created using the legacy whitelabel tool. If it is a legacy whitelabel, it will still function, but you'll need to create a new Reverse DNS if you need to update it. + Legacy bool `json:"legacy"` + // A Unix epoch timestamp representing the last time of a validation attempt. + LastValidationAttemptAt *int32 `json:"last_validation_attempt_at,omitempty"` + ARecord ReverseDnsARecord `json:"a_record"` +} diff --git a/rest/api/v3/reverse_dns/model_reverse_dns_a_record.go b/rest/api/v3/reverse_dns/model_reverse_dns_a_record.go new file mode 100644 index 00000000..646a9624 --- /dev/null +++ b/rest/api/v3/reverse_dns/model_reverse_dns_a_record.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ReverseDnsARecord struct for ReverseDnsARecord +type ReverseDnsARecord struct { + // Indicates if the a_record is valid. + Valid bool `json:"valid"` + // The type of DNS record. + Type string `json:"type"` + // This is the web address that will be mapped to the IP address. + Host string `json:"host"` + // The IP address being set up with Reverse DNS. + Data string `json:"data"` +} diff --git a/rest/api/v3/reverse_dns/model_reverse_dns_users_inner.go b/rest/api/v3/reverse_dns/model_reverse_dns_users_inner.go new file mode 100644 index 00000000..6b6ee09c --- /dev/null +++ b/rest/api/v3/reverse_dns/model_reverse_dns_users_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ReverseDnsUsersInner struct for ReverseDnsUsersInner +type ReverseDnsUsersInner struct { + // The username of a user who can send mail from the IP address. + Username string `json:"username"` + // The ID of a user who can send mail from the IP address. + UserId int32 `json:"user_id"` +} diff --git a/rest/api/v3/reverse_dns/model_set_up_reverse_dns_request.go b/rest/api/v3/reverse_dns/model_set_up_reverse_dns_request.go new file mode 100644 index 00000000..9cdc1c22 --- /dev/null +++ b/rest/api/v3/reverse_dns/model_set_up_reverse_dns_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SetUpReverseDnsRequest struct for SetUpReverseDnsRequest +type SetUpReverseDnsRequest struct { + // The IP address for which you want to set up reverse DNS. + Ip string `json:"ip"` + // The subdomain that will be used to send emails from the IP address. This should be the same as the subdomain used to set up an authenticated domain. + Subdomain *string `json:"subdomain,omitempty"` + // The root, or sending, domain that will be used to send message from the IP address. + Domain string `json:"domain"` +} diff --git a/rest/api/v3/reverse_dns/model_valid.go b/rest/api/v3/reverse_dns/model_valid.go new file mode 100644 index 00000000..5a8ea14f --- /dev/null +++ b/rest/api/v3/reverse_dns/model_valid.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid the model 'Valid' +type Valid bool + +// List of Valid +const ( + VALID_TRUE Valid = true + VALID_FALSE Valid = false +) diff --git a/rest/api/v3/reverse_dns/model_valid1.go b/rest/api/v3/reverse_dns/model_valid1.go new file mode 100644 index 00000000..b4e28b4a --- /dev/null +++ b/rest/api/v3/reverse_dns/model_valid1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Valid1 the model 'Valid1' +type Valid1 bool + +// List of Valid1 +const ( + VALID1_TRUE Valid1 = true + VALID1_FALSE Valid1 = false +) diff --git a/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response.go b/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response.go new file mode 100644 index 00000000..f44812f5 --- /dev/null +++ b/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateReverseDns200Response struct for ValidateReverseDns200Response +type ValidateReverseDns200Response struct { + // The ID of the reverse DNS record. + Id int32 `json:"id"` + // Indicates if the reverse DNS record is valid. + Valid Valid `json:"valid"` + ValidationResults ValidateReverseDns200ResponseValidationResults `json:"validation_results"` +} diff --git a/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results.go b/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results.go new file mode 100644 index 00000000..9859bcfc --- /dev/null +++ b/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateReverseDns200ResponseValidationResults The specific results of the validation. +type ValidateReverseDns200ResponseValidationResults struct { + ARecord *ValidateReverseDns200ResponseValidationResultsARecord `json:"a_record,omitempty"` +} diff --git a/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results_a_record.go b/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results_a_record.go new file mode 100644 index 00000000..30a88911 --- /dev/null +++ b/rest/api/v3/reverse_dns/model_validate_reverse_dns_200_response_validation_results_a_record.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateReverseDns200ResponseValidationResultsARecord struct for ValidateReverseDns200ResponseValidationResultsARecord +type ValidateReverseDns200ResponseValidationResultsARecord struct { + // Indicates if the reverse DNS record could be validated. + Valid Valid1 `json:"valid"` + // The reason the reverse DNS record could not be validated. Is `null` if the reverse DNS record was validated. + Reason string `json:"reason"` +} diff --git a/rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response.go b/rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response.go new file mode 100644 index 00000000..f1d7b077 --- /dev/null +++ b/rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateReverseDns404Response struct for ValidateReverseDns404Response +type ValidateReverseDns404Response struct { + // The error messages for the failed validation. + Errors []ValidateReverseDns404ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response_errors_inner.go b/rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response_errors_inner.go new file mode 100644 index 00000000..c214310b --- /dev/null +++ b/rest/api/v3/reverse_dns/model_validate_reverse_dns_404_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateReverseDns404ResponseErrorsInner struct for ValidateReverseDns404ResponseErrorsInner +type ValidateReverseDns404ResponseErrorsInner struct { + // A message describing why the reverse DNS could not be validated. + Message string `json:"message"` +} diff --git a/rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response.go b/rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response.go new file mode 100644 index 00000000..61e3fc40 --- /dev/null +++ b/rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateReverseDns500Response struct for ValidateReverseDns500Response +type ValidateReverseDns500Response struct { + // The error messages for the failed validation. + Errors []ValidateReverseDns500ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response_errors_inner.go b/rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response_errors_inner.go new file mode 100644 index 00000000..0e85cc78 --- /dev/null +++ b/rest/api/v3/reverse_dns/model_validate_reverse_dns_500_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Reverse DNS API +* The Twilio SendGrid Reverse DNS API (formerly IP Whitelabel) allows you to configure reverse DNS settings for your account. Mailbox providers verify the sender of your emails by performing a reverse DNS lookup. When setting up Reverse DNS, Twilio SendGrid will provide an A Record (address record) for you to add to the DNS records of your sending domain. The A record maps your sending domain to a dedicated Twilio SendGrid IP address. Once Twilio SendGrid has verified that the appropriate A record for the IP address has been created, the appropriate reverse DNS record for the IP address is generated. Reverse DNS is available for [dedicated IP addresses](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) only. You can also manage your reverse DNS settings in the Sender Authentication setion of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**How to Set Up Reverse DNS**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ValidateReverseDns500ResponseErrorsInner struct for ValidateReverseDns500ResponseErrorsInner +type ValidateReverseDns500ResponseErrorsInner struct { + // A message describing why the IP whitelabel could not be validated. + Message string `json:"message"` +} diff --git a/rest/api/v3/scheduled_sends/README.md b/rest/api/v3/scheduled_sends/README.md new file mode 100644 index 00000000..8c2cd905 --- /dev/null +++ b/rest/api/v3/scheduled_sends/README.md @@ -0,0 +1,82 @@ +# Go API client for + +The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. + +A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. + +See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. + +See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. + +When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. + +When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.346578+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateScheduledSend* | [**CreateScheduledSend**](docs/CreateScheduledSend.md#createscheduledsend) | **Post** /v3/user/scheduled_sends | Cancel or pause a scheduled send +*DeleteScheduledSend* | [**DeleteScheduledSend**](docs/DeleteScheduledSend.md#deletescheduledsend) | **Delete** /v3/user/scheduled_sends/{BatchId} | Delete a cancellation or pause from a scheduled send +*GetScheduledSend* | [**GetScheduledSend**](docs/GetScheduledSend.md#getscheduledsend) | **Get** /v3/user/scheduled_sends/{BatchId} | Retrieve scheduled send +*ListScheduledSend* | [**ListScheduledSend**](docs/ListScheduledSend.md#listscheduledsend) | **Get** /v3/user/scheduled_sends | Retrieve all scheduled sends +*UpdateScheduledSend* | [**UpdateScheduledSend**](docs/UpdateScheduledSend.md#updatescheduledsend) | **Patch** /v3/user/scheduled_sends/{BatchId} | Update a scheduled send + + +## Documentation For Models + + - [CancelOrPauseAScheduledSendRequest](CancelOrPauseAScheduledSendRequest.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [MailBatchId](MailBatchId.md) + - [ScheduledSendStatus](ScheduledSendStatus.md) + - [Status](Status.md) + - [Status1](Status1.md) + - [Status2](Status2.md) + - [UpdateScheduledSendRequest](UpdateScheduledSendRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/scheduled_sends/api_create_scheduled_send.go b/rest/api/v3/scheduled_sends/api_create_scheduled_send.go new file mode 100644 index 00000000..536ba3b9 --- /dev/null +++ b/rest/api/v3/scheduled_sends/api_create_scheduled_send.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateScheduledSendParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CancelOrPauseAScheduledSendRequest *CancelOrPauseAScheduledSendRequest `json:"CancelOrPauseAScheduledSendRequest,omitempty"` +} + +func (params *CreateScheduledSendParam) SetOnbehalfof(Onbehalfof string) *CreateScheduledSendParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateScheduledSendParam) SetCancelOrPauseAScheduledSendRequest(CancelOrPauseAScheduledSendRequest CancelOrPauseAScheduledSendRequest) *CreateScheduledSendParam { + params.CancelOrPauseAScheduledSendRequest = &CancelOrPauseAScheduledSendRequest + return params +} + +// **This endpoint allows you to cancel or pause a scheduled send associated with a `batch_id`.** Passing this endpoint a `batch_id` and status will cancel or pause the scheduled send. Once a scheduled send is set to `pause` or `cancel` you must use the \"Update a scheduled send\" endpoint to change its status or the \"Delete a cancellation or pause from a scheduled send\" endpoint to remove the status. Passing a status change to a scheduled send that has already been paused or cancelled will result in a `400` level status code. If the maximum number of cancellations/pauses are added to a send, a `400` level status code will be returned. +func (c *ApiService) CreateScheduledSend(params *CreateScheduledSendParam) (interface{}, error) { + path := "/v3/user/scheduled_sends" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CancelOrPauseAScheduledSendRequest != nil { + b, err := json.Marshal(*params.CancelOrPauseAScheduledSendRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ScheduledSendStatus{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scheduled_sends/api_delete_scheduled_send.go b/rest/api/v3/scheduled_sends/api_delete_scheduled_send.go new file mode 100644 index 00000000..ed4e6a6e --- /dev/null +++ b/rest/api/v3/scheduled_sends/api_delete_scheduled_send.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteScheduledSendParam struct { + // + BatchId *string `json:"batch_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteScheduledSendParam) SetBatchId(BatchId string) *DeleteScheduledSendParam { + params.BatchId = &BatchId + return params +} +func (params *DeleteScheduledSendParam) SetOnbehalfof(Onbehalfof string) *DeleteScheduledSendParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete the cancellation/pause of a scheduled send.** Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +func (c *ApiService) DeleteScheduledSend(params *DeleteScheduledSendParam) (interface{}, error) { + path := "/v3/user/scheduled_sends/{BatchId}" + if params != nil && params.BatchId != nil { + path = strings.Replace(path, "{"+"BatchId"+"}", *params.BatchId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scheduled_sends/api_get_scheduled_send.go b/rest/api/v3/scheduled_sends/api_get_scheduled_send.go new file mode 100644 index 00000000..b254b33b --- /dev/null +++ b/rest/api/v3/scheduled_sends/api_get_scheduled_send.go @@ -0,0 +1,102 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetScheduledSendParam struct { + // + BatchId *string `json:"batch_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetScheduledSendParam) SetBatchId(BatchId string) *GetScheduledSendParam { + params.BatchId = &BatchId + return params +} +func (params *GetScheduledSendParam) SetOnbehalfof(Onbehalfof string) *GetScheduledSendParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** +func (c *ApiService) GetScheduledSend(params *GetScheduledSendParam) (interface{}, error) { + path := "/v3/user/scheduled_sends/{BatchId}" + if params != nil && params.BatchId != nil { + path = strings.Replace(path, "{"+"BatchId"+"}", *params.BatchId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ScheduledSendStatus{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scheduled_sends/api_list_scheduled_send.go b/rest/api/v3/scheduled_sends/api_list_scheduled_send.go new file mode 100644 index 00000000..4c179891 --- /dev/null +++ b/rest/api/v3/scheduled_sends/api_list_scheduled_send.go @@ -0,0 +1,91 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListScheduledSendParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListScheduledSendParam) SetOnbehalfof(Onbehalfof string) *ListScheduledSendParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all cancelled and paused scheduled send information.** This endpoint will return only the scheduled sends that are associated with a `batch_id`. If you have scheduled a send using the `/mail/send` endpoint and the `send_at` field but no `batch_id`, the send will be scheduled for delivery; however, it will not be returned by this endpoint. For this reason, you should assign a `batch_id` to any scheduled send you may need to pause or cancel in the future. +func (c *ApiService) ListScheduledSend(params *ListScheduledSendParam) (interface{}, error) { + path := "/v3/user/scheduled_sends" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ScheduledSendStatus{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scheduled_sends/api_service.go b/rest/api/v3/scheduled_sends/api_service.go new file mode 100644 index 00000000..e86bc8be --- /dev/null +++ b/rest/api/v3/scheduled_sends/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/scheduled_sends/api_update_scheduled_send.go b/rest/api/v3/scheduled_sends/api_update_scheduled_send.go new file mode 100644 index 00000000..6627c809 --- /dev/null +++ b/rest/api/v3/scheduled_sends/api_update_scheduled_send.go @@ -0,0 +1,109 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateScheduledSendParam struct { + // + BatchId *string `json:"batch_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateScheduledSendRequest *UpdateScheduledSendRequest `json:"UpdateScheduledSendRequest,omitempty"` +} + +func (params *UpdateScheduledSendParam) SetBatchId(BatchId string) *UpdateScheduledSendParam { + params.BatchId = &BatchId + return params +} +func (params *UpdateScheduledSendParam) SetOnbehalfof(Onbehalfof string) *UpdateScheduledSendParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateScheduledSendParam) SetUpdateScheduledSendRequest(UpdateScheduledSendRequest UpdateScheduledSendRequest) *UpdateScheduledSendParam { + params.UpdateScheduledSendRequest = &UpdateScheduledSendRequest + return params +} + +// **This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** If you have already set a `cancel` or `pause` status on a scheduled send using the \"Cancel or pause a scheduled send\" endpoint, you can update it's status using this endpoint. Attempting to update a status once it has been set with the \"Cancel or pause a scheduled send\" endpoint will result in a `400` error. +func (c *ApiService) UpdateScheduledSend(params *UpdateScheduledSendParam) (interface{}, error) { + path := "/v3/user/scheduled_sends/{BatchId}" + if params != nil && params.BatchId != nil { + path = strings.Replace(path, "{"+"BatchId"+"}", *params.BatchId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateScheduledSendRequest != nil { + b, err := json.Marshal(*params.UpdateScheduledSendRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scheduled_sends/docs/CancelOrPauseAScheduledSendRequest.md b/rest/api/v3/scheduled_sends/docs/CancelOrPauseAScheduledSendRequest.md new file mode 100644 index 00000000..1c192628 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/CancelOrPauseAScheduledSendRequest.md @@ -0,0 +1,12 @@ +# CancelOrPauseAScheduledSendRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BatchId** | **string** | The batch ID is the identifier that your scheduled mail sends share. | +**Status** | [**Status**](Status.md) | The status of the send you would like to implement. This can be pause or cancel. To delete a pause or cancel status see DELETE /v3/user/scheduled_sends/{batch_id} | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/CreateScheduledSend.md b/rest/api/v3/scheduled_sends/docs/CreateScheduledSend.md new file mode 100644 index 00000000..e72ddd5b --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/CreateScheduledSend.md @@ -0,0 +1,49 @@ +# CreateScheduledSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateScheduledSend**](CreateScheduledSend.md#CreateScheduledSend) | **Post** /v3/user/scheduled_sends | Cancel or pause a scheduled send + + + +## CreateScheduledSend + +> ScheduledSendStatus CreateScheduledSend(ctx, optional) + +Cancel or pause a scheduled send + +**This endpoint allows you to cancel or pause a scheduled send associated with a `batch_id`.** Passing this endpoint a `batch_id` and status will cancel or pause the scheduled send. Once a scheduled send is set to `pause` or `cancel` you must use the \"Update a scheduled send\" endpoint to change its status or the \"Delete a cancellation or pause from a scheduled send\" endpoint to remove the status. Passing a status change to a scheduled send that has already been paused or cancelled will result in a `400` level status code. If the maximum number of cancellations/pauses are added to a send, a `400` level status code will be returned. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateScheduledSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CancelOrPauseAScheduledSendRequest** | [**CancelOrPauseAScheduledSendRequest**](CancelOrPauseAScheduledSendRequest.md) | + +### Return type + +[**ScheduledSendStatus**](ScheduledSendStatus.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scheduled_sends/docs/DeleteScheduledSend.md b/rest/api/v3/scheduled_sends/docs/DeleteScheduledSend.md new file mode 100644 index 00000000..1d198b9d --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/DeleteScheduledSend.md @@ -0,0 +1,52 @@ +# DeleteScheduledSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteScheduledSend**](DeleteScheduledSend.md#DeleteScheduledSend) | **Delete** /v3/user/scheduled_sends/{BatchId} | Delete a cancellation or pause from a scheduled send + + + +## DeleteScheduledSend + +> DeleteScheduledSend(ctx, BatchIdoptional) + +Delete a cancellation or pause from a scheduled send + +**This endpoint allows you to delete the cancellation/pause of a scheduled send.** Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**BatchId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteScheduledSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scheduled_sends/docs/ErrorResponse.md b/rest/api/v3/scheduled_sends/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/ErrorResponseErrorsInner.md b/rest/api/v3/scheduled_sends/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/GetScheduledSend.md b/rest/api/v3/scheduled_sends/docs/GetScheduledSend.md new file mode 100644 index 00000000..1f9e8925 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/GetScheduledSend.md @@ -0,0 +1,52 @@ +# GetScheduledSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetScheduledSend**](GetScheduledSend.md#GetScheduledSend) | **Get** /v3/user/scheduled_sends/{BatchId} | Retrieve scheduled send + + + +## GetScheduledSend + +> []ScheduledSendStatus GetScheduledSend(ctx, BatchIdoptional) + +Retrieve scheduled send + +**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**BatchId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetScheduledSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]ScheduledSendStatus**](ScheduledSendStatus.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scheduled_sends/docs/ListScheduledSend.md b/rest/api/v3/scheduled_sends/docs/ListScheduledSend.md new file mode 100644 index 00000000..e6fbb8fe --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/ListScheduledSend.md @@ -0,0 +1,48 @@ +# ListScheduledSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListScheduledSend**](ListScheduledSend.md#ListScheduledSend) | **Get** /v3/user/scheduled_sends | Retrieve all scheduled sends + + + +## ListScheduledSend + +> []ScheduledSendStatus ListScheduledSend(ctx, optional) + +Retrieve all scheduled sends + +**This endpoint allows you to retrieve all cancelled and paused scheduled send information.** This endpoint will return only the scheduled sends that are associated with a `batch_id`. If you have scheduled a send using the `/mail/send` endpoint and the `send_at` field but no `batch_id`, the send will be scheduled for delivery; however, it will not be returned by this endpoint. For this reason, you should assign a `batch_id` to any scheduled send you may need to pause or cancel in the future. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListScheduledSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]ScheduledSendStatus**](ScheduledSendStatus.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scheduled_sends/docs/MailBatchId.md b/rest/api/v3/scheduled_sends/docs/MailBatchId.md new file mode 100644 index 00000000..9537317a --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/MailBatchId.md @@ -0,0 +1,11 @@ +# MailBatchId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BatchId** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/ScheduledSendStatus.md b/rest/api/v3/scheduled_sends/docs/ScheduledSendStatus.md new file mode 100644 index 00000000..c5498cc4 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/ScheduledSendStatus.md @@ -0,0 +1,12 @@ +# ScheduledSendStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BatchId** | **string** | | +**Status** | [**Status2**](Status2.md) | The status of the scheduled send. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/Status.md b/rest/api/v3/scheduled_sends/docs/Status.md new file mode 100644 index 00000000..8a3e53e1 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/Status.md @@ -0,0 +1,13 @@ +# Status + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PAUSE** | string | (value: `"pause"`) +**CANCEL** | string | (value: `"cancel"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/Status1.md b/rest/api/v3/scheduled_sends/docs/Status1.md new file mode 100644 index 00000000..0dcc9ff0 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/Status1.md @@ -0,0 +1,13 @@ +# Status1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CANCEL** | string | (value: `"cancel"`) +**PAUSE** | string | (value: `"pause"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/Status2.md b/rest/api/v3/scheduled_sends/docs/Status2.md new file mode 100644 index 00000000..5c7d4c92 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/Status2.md @@ -0,0 +1,13 @@ +# Status2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CANCEL** | string | (value: `"cancel"`) +**PAUSE** | string | (value: `"pause"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/docs/UpdateScheduledSend.md b/rest/api/v3/scheduled_sends/docs/UpdateScheduledSend.md new file mode 100644 index 00000000..b2ec61ee --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/UpdateScheduledSend.md @@ -0,0 +1,53 @@ +# UpdateScheduledSend + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateScheduledSend**](UpdateScheduledSend.md#UpdateScheduledSend) | **Patch** /v3/user/scheduled_sends/{BatchId} | Update a scheduled send + + + +## UpdateScheduledSend + +> interface{} UpdateScheduledSend(ctx, BatchIdoptional) + +Update a scheduled send + +**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** If you have already set a `cancel` or `pause` status on a scheduled send using the \"Cancel or pause a scheduled send\" endpoint, you can update it's status using this endpoint. Attempting to update a status once it has been set with the \"Cancel or pause a scheduled send\" endpoint will result in a `400` error. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**BatchId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateScheduledSendParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateScheduledSendRequest** | [**UpdateScheduledSendRequest**](UpdateScheduledSendRequest.md) | + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scheduled_sends/docs/UpdateScheduledSendRequest.md b/rest/api/v3/scheduled_sends/docs/UpdateScheduledSendRequest.md new file mode 100644 index 00000000..a01e9aa8 --- /dev/null +++ b/rest/api/v3/scheduled_sends/docs/UpdateScheduledSendRequest.md @@ -0,0 +1,11 @@ +# UpdateScheduledSendRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | [**Status1**](Status1.md) | The status you would like the scheduled send to have. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scheduled_sends/model_cancel_or_pause_a_scheduled_send_request.go b/rest/api/v3/scheduled_sends/model_cancel_or_pause_a_scheduled_send_request.go new file mode 100644 index 00000000..6e635983 --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_cancel_or_pause_a_scheduled_send_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CancelOrPauseAScheduledSendRequest struct for CancelOrPauseAScheduledSendRequest +type CancelOrPauseAScheduledSendRequest struct { + // The batch ID is the identifier that your scheduled mail sends share. + BatchId string `json:"batch_id"` + // The status of the send you would like to implement. This can be pause or cancel. To delete a pause or cancel status see DELETE /v3/user/scheduled_sends/{batch_id} + Status Status `json:"status"` +} diff --git a/rest/api/v3/scheduled_sends/model_error_response.go b/rest/api/v3/scheduled_sends/model_error_response.go new file mode 100644 index 00000000..894e8251 --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/scheduled_sends/model_error_response_errors_inner.go b/rest/api/v3/scheduled_sends/model_error_response_errors_inner.go new file mode 100644 index 00000000..341c7d99 --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/scheduled_sends/model_mail_batch_id.go b/rest/api/v3/scheduled_sends/model_mail_batch_id.go new file mode 100644 index 00000000..dbd323c8 --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_mail_batch_id.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// MailBatchId struct for MailBatchId +type MailBatchId struct { + BatchId string `json:"batch_id"` +} diff --git a/rest/api/v3/scheduled_sends/model_scheduled_send_status.go b/rest/api/v3/scheduled_sends/model_scheduled_send_status.go new file mode 100644 index 00000000..d6fe3d8f --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_scheduled_send_status.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ScheduledSendStatus struct for ScheduledSendStatus +type ScheduledSendStatus struct { + BatchId string `json:"batch_id"` + // The status of the scheduled send. + Status Status2 `json:"status"` +} diff --git a/rest/api/v3/scheduled_sends/model_status.go b/rest/api/v3/scheduled_sends/model_status.go new file mode 100644 index 00000000..d31bbe05 --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_status.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status the model 'Status' +type Status string + +// List of Status +const ( + STATUS_PAUSE Status = "pause" + STATUS_CANCEL Status = "cancel" +) diff --git a/rest/api/v3/scheduled_sends/model_status1.go b/rest/api/v3/scheduled_sends/model_status1.go new file mode 100644 index 00000000..c43f388d --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_status1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status1 the model 'Status1' +type Status1 string + +// List of Status1 +const ( + STATUS1_CANCEL Status1 = "cancel" + STATUS1_PAUSE Status1 = "pause" +) diff --git a/rest/api/v3/scheduled_sends/model_status2.go b/rest/api/v3/scheduled_sends/model_status2.go new file mode 100644 index 00000000..96ac6a91 --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_status2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Status2 the model 'Status2' +type Status2 string + +// List of Status2 +const ( + STATUS2_CANCEL Status2 = "cancel" + STATUS2_PAUSE Status2 = "pause" +) diff --git a/rest/api/v3/scheduled_sends/model_update_scheduled_send_request.go b/rest/api/v3/scheduled_sends/model_update_scheduled_send_request.go new file mode 100644 index 00000000..fb8b4ac2 --- /dev/null +++ b/rest/api/v3/scheduled_sends/model_update_scheduled_send_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scheduled Sends API +* The Twilio SendGrid Scheduled Sends API allows you to cancel or pause the send of one or more emails using a batch ID. A `batch_id` groups multiple scheduled mail send requests together with the same ID. You can cancel or pause all of the requests associated with a batch ID up to 10 minutes before the scheduled send time. See [**Canceling a Scheduled Send**](https://docs.sendgrid.com/for-developers/sending-email/stopping-a-scheduled-send) for a guide on creating a `batch_id`, assigning it to a scheduled send, and modifying the send. See the Mail API's batching operations to validate a `batch_id` and retrieve all scheduled sends as an array. When a batch is canceled, all messages associated with that batch will stay in your sending queue. When their `send_at` value is reached, they will be discarded. When a batch is paused, all messages associated with that batch will stay in your sending queue, even after their `send_at` value has passed. This means you can remove a pause status, and your scheduled send will be delivered once the pause is removed. Any messages left with a pause status that are more than 72 hours old will be discarded as Expired. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateScheduledSendRequest struct for UpdateScheduledSendRequest +type UpdateScheduledSendRequest struct { + // The status you would like the scheduled send to have. + Status Status1 `json:"status"` +} diff --git a/rest/api/v3/scopes/README.md b/rest/api/v3/scopes/README.md new file mode 100644 index 00000000..f7d951c0 --- /dev/null +++ b/rest/api/v3/scopes/README.md @@ -0,0 +1,71 @@ +# Go API client for + +The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.375456+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ApproveScopeRequest* | [**ApproveScopeRequest**](docs/ApproveScopeRequest.md#approvescoperequest) | **Patch** /v3/scopes/requests/{RequestId}/approve | Approve access request +*DenyScopeRequest* | [**DenyScopeRequest**](docs/DenyScopeRequest.md#denyscoperequest) | **Delete** /v3/scopes/requests/{RequestId} | Deny access request +*ListScope* | [**ListScope**](docs/ListScope.md#listscope) | **Get** /v3/scopes | Retrieve a list of scopes for which this user has access. +*ListScopeRequest* | [**ListScopeRequest**](docs/ListScopeRequest.md#listscoperequest) | **Get** /v3/scopes/requests | Retrieve access requests + + +## Documentation For Models + + - [ApproveScopeRequest200Response](ApproveScopeRequest200Response.md) + - [DenyScopeRequest404Response](DenyScopeRequest404Response.md) + - [DenyScopeRequest404ResponseErrorsInner](DenyScopeRequest404ResponseErrorsInner.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [ListScope200Response](ListScope200Response.md) + - [ListScope401Response](ListScope401Response.md) + - [ListScope401ResponseErrorsInner](ListScope401ResponseErrorsInner.md) + - [ListScopeRequest200ResponseInner](ListScopeRequest200ResponseInner.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/scopes/api_approve_scope_request.go b/rest/api/v3/scopes/api_approve_scope_request.go new file mode 100644 index 00000000..9c23ae58 --- /dev/null +++ b/rest/api/v3/scopes/api_approve_scope_request.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ApproveScopeRequestParam struct { + // The ID of the request that you want to approve. + RequestId *string `json:"request_id"` +} + +func (params *ApproveScopeRequestParam) SetRequestId(RequestId string) *ApproveScopeRequestParam { + params.RequestId = &RequestId + return params +} + +// **This endpoint allows you to approve an access attempt.** **Note:** Only teammate admins may approve another teammate’s access request. +func (c *ApiService) ApproveScopeRequest(params *ApproveScopeRequestParam) (interface{}, error) { + path := "/v3/scopes/requests/{RequestId}/approve" + if params != nil && params.RequestId != nil { + path = strings.Replace(path, "{"+"RequestId"+"}", *params.RequestId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ApproveScopeRequest200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DenyScopeRequest404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scopes/api_deny_scope_request.go b/rest/api/v3/scopes/api_deny_scope_request.go new file mode 100644 index 00000000..71ad46ff --- /dev/null +++ b/rest/api/v3/scopes/api_deny_scope_request.go @@ -0,0 +1,61 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DenyScopeRequestParam struct { + // The ID of the request that you want to deny. + RequestId *string `json:"request_id"` +} + +func (params *DenyScopeRequestParam) SetRequestId(RequestId string) *DenyScopeRequestParam { + params.RequestId = &RequestId + return params +} + +// **This endpoint allows you to deny an attempt to access your account.** **Note:** Only teammate admins may delete a teammate's access request. +func (c *ApiService) DenyScopeRequest(params *DenyScopeRequestParam) (interface{}, error) { + path := "/v3/scopes/requests/{RequestId}" + if params != nil && params.RequestId != nil { + path = strings.Replace(path, "{"+"RequestId"+"}", *params.RequestId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 404 { + ps := &DenyScopeRequest404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scopes/api_list_scope.go b/rest/api/v3/scopes/api_list_scope.go new file mode 100644 index 00000000..67384406 --- /dev/null +++ b/rest/api/v3/scopes/api_list_scope.go @@ -0,0 +1,91 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListScopeParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListScopeParam) SetOnbehalfof(Onbehalfof string) *ListScopeParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint returns a list of all scopes that this user has access to.** API Keys are used to authenticate with [SendGrid's v3 API](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. This endpoint returns all the scopes assigned to the key you use to authenticate with it. To retrieve the scopes assigned to another key, you can pass an API key ID to the \"Retrieve an existing API key\" endpoint. For a more detailed explanation of how you can use API Key permissions, please visit our [API Keys documentation](https://sendgrid.com/docs/ui/account-and-settings/api-keys/). +func (c *ApiService) ListScope(params *ListScopeParam) (interface{}, error) { + path := "/v3/scopes" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListScope200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ListScope401Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scopes/api_list_scope_request.go b/rest/api/v3/scopes/api_list_scope_request.go new file mode 100644 index 00000000..9cf8ed7e --- /dev/null +++ b/rest/api/v3/scopes/api_list_scope_request.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListScopeRequestParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` +} + +func (params *ListScopeRequestParam) SetLimit(Limit int32) *ListScopeRequestParam { + params.Limit = &Limit + return params +} +func (params *ListScopeRequestParam) SetOffset(Offset int32) *ListScopeRequestParam { + params.Offset = &Offset + return params +} + +// **This endpoint allows you to retrieve a paginated list of all recent access requests.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListScopeRequest(params *ListScopeRequestParam) (interface{}, error) { + path := "/v3/scopes/requests" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListScopeRequest200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/scopes/api_service.go b/rest/api/v3/scopes/api_service.go new file mode 100644 index 00000000..bc846141 --- /dev/null +++ b/rest/api/v3/scopes/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/scopes/docs/ApproveScopeRequest.md b/rest/api/v3/scopes/docs/ApproveScopeRequest.md new file mode 100644 index 00000000..2b701325 --- /dev/null +++ b/rest/api/v3/scopes/docs/ApproveScopeRequest.md @@ -0,0 +1,51 @@ +# ApproveScopeRequest + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ApproveScopeRequest**](ApproveScopeRequest.md#ApproveScopeRequest) | **Patch** /v3/scopes/requests/{RequestId}/approve | Approve access request + + + +## ApproveScopeRequest + +> ApproveScopeRequest200Response ApproveScopeRequest(ctx, RequestId) + +Approve access request + +**This endpoint allows you to approve an access attempt.** **Note:** Only teammate admins may approve another teammate’s access request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**RequestId** | **string** | The ID of the request that you want to approve. + +### Other Parameters + +Other parameters are passed through a pointer to a ApproveScopeRequestParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**ApproveScopeRequest200Response**](ApproveScopeRequest200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scopes/docs/ApproveScopeRequest200Response.md b/rest/api/v3/scopes/docs/ApproveScopeRequest200Response.md new file mode 100644 index 00000000..99c4ce7e --- /dev/null +++ b/rest/api/v3/scopes/docs/ApproveScopeRequest200Response.md @@ -0,0 +1,11 @@ +# ApproveScopeRequest200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ScopeGroupName** | **string** | name of feature teammate will be given access to |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/DenyScopeRequest.md b/rest/api/v3/scopes/docs/DenyScopeRequest.md new file mode 100644 index 00000000..56947c47 --- /dev/null +++ b/rest/api/v3/scopes/docs/DenyScopeRequest.md @@ -0,0 +1,51 @@ +# DenyScopeRequest + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DenyScopeRequest**](DenyScopeRequest.md#DenyScopeRequest) | **Delete** /v3/scopes/requests/{RequestId} | Deny access request + + + +## DenyScopeRequest + +> DenyScopeRequest(ctx, RequestId) + +Deny access request + +**This endpoint allows you to deny an attempt to access your account.** **Note:** Only teammate admins may delete a teammate's access request. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**RequestId** | **string** | The ID of the request that you want to deny. + +### Other Parameters + +Other parameters are passed through a pointer to a DenyScopeRequestParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scopes/docs/DenyScopeRequest404Response.md b/rest/api/v3/scopes/docs/DenyScopeRequest404Response.md new file mode 100644 index 00000000..4a41f9dd --- /dev/null +++ b/rest/api/v3/scopes/docs/DenyScopeRequest404Response.md @@ -0,0 +1,11 @@ +# DenyScopeRequest404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]DenyScopeRequest404ResponseErrorsInner**](DenyScopeRequest404ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/DenyScopeRequest404ResponseErrorsInner.md b/rest/api/v3/scopes/docs/DenyScopeRequest404ResponseErrorsInner.md new file mode 100644 index 00000000..6f6d4c6a --- /dev/null +++ b/rest/api/v3/scopes/docs/DenyScopeRequest404ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# DenyScopeRequest404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**Field** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/ErrorResponse.md b/rest/api/v3/scopes/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/scopes/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/ErrorResponseErrorsInner.md b/rest/api/v3/scopes/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/scopes/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/ListScope.md b/rest/api/v3/scopes/docs/ListScope.md new file mode 100644 index 00000000..01d7815e --- /dev/null +++ b/rest/api/v3/scopes/docs/ListScope.md @@ -0,0 +1,48 @@ +# ListScope + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListScope**](ListScope.md#ListScope) | **Get** /v3/scopes | Retrieve a list of scopes for which this user has access. + + + +## ListScope + +> ListScope200Response ListScope(ctx, optional) + +Retrieve a list of scopes for which this user has access. + +**This endpoint returns a list of all scopes that this user has access to.** API Keys are used to authenticate with [SendGrid's v3 API](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/authorization). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. This endpoint returns all the scopes assigned to the key you use to authenticate with it. To retrieve the scopes assigned to another key, you can pass an API key ID to the \"Retrieve an existing API key\" endpoint. For a more detailed explanation of how you can use API Key permissions, please visit our [API Keys documentation](https://sendgrid.com/docs/ui/account-and-settings/api-keys/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListScopeParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListScope200Response**](ListScope200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scopes/docs/ListScope200Response.md b/rest/api/v3/scopes/docs/ListScope200Response.md new file mode 100644 index 00000000..d21786da --- /dev/null +++ b/rest/api/v3/scopes/docs/ListScope200Response.md @@ -0,0 +1,11 @@ +# ListScope200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Scopes** | **[]string** | The list of scopes for which this user has access. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/ListScope401Response.md b/rest/api/v3/scopes/docs/ListScope401Response.md new file mode 100644 index 00000000..0ee64c00 --- /dev/null +++ b/rest/api/v3/scopes/docs/ListScope401Response.md @@ -0,0 +1,11 @@ +# ListScope401Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListScope401ResponseErrorsInner**](ListScope401ResponseErrorsInner.md) | This 401 response indicates that the user making the call doesn't have the authorization to view the list of scopes. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/ListScope401ResponseErrorsInner.md b/rest/api/v3/scopes/docs/ListScope401ResponseErrorsInner.md new file mode 100644 index 00000000..533dc68c --- /dev/null +++ b/rest/api/v3/scopes/docs/ListScope401ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# ListScope401ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | This empty field is returned instead of the list of scopes if the user making the call doesn't have the authorization required. |[optional] +**Message** | **string** | Explains why the scopes cannot be returned. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/docs/ListScopeRequest.md b/rest/api/v3/scopes/docs/ListScopeRequest.md new file mode 100644 index 00000000..9af40e3c --- /dev/null +++ b/rest/api/v3/scopes/docs/ListScopeRequest.md @@ -0,0 +1,49 @@ +# ListScopeRequest + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListScopeRequest**](ListScopeRequest.md#ListScopeRequest) | **Get** /v3/scopes/requests | Retrieve access requests + + + +## ListScopeRequest + +> []ListScopeRequest200ResponseInner ListScopeRequest(ctx, optional) + +Retrieve access requests + +**This endpoint allows you to retrieve a paginated list of all recent access requests.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListScopeRequestParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + +### Return type + +[**[]ListScopeRequest200ResponseInner**](ListScopeRequest200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/scopes/docs/ListScopeRequest200ResponseInner.md b/rest/api/v3/scopes/docs/ListScopeRequest200ResponseInner.md new file mode 100644 index 00000000..10495fad --- /dev/null +++ b/rest/api/v3/scopes/docs/ListScopeRequest200ResponseInner.md @@ -0,0 +1,16 @@ +# ListScopeRequest200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | Request ID |[optional] +**ScopeGroupName** | **string** | Name of group of scopes associated to page teammate is requesting access to |[optional] +**Username** | **string** | Teammate's username |[optional] +**Email** | **string** | Teammate's email |[optional] +**FirstName** | **string** | Teammate's first name |[optional] +**LastName** | **string** | Teammate's last name |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/scopes/model_approve_scope_request_200_response.go b/rest/api/v3/scopes/model_approve_scope_request_200_response.go new file mode 100644 index 00000000..38fd571e --- /dev/null +++ b/rest/api/v3/scopes/model_approve_scope_request_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ApproveScopeRequest200Response struct for ApproveScopeRequest200Response +type ApproveScopeRequest200Response struct { + // name of feature teammate will be given access to + ScopeGroupName *string `json:"scope_group_name,omitempty"` +} diff --git a/rest/api/v3/scopes/model_deny_scope_request_404_response.go b/rest/api/v3/scopes/model_deny_scope_request_404_response.go new file mode 100644 index 00000000..0117edee --- /dev/null +++ b/rest/api/v3/scopes/model_deny_scope_request_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DenyScopeRequest404Response struct for DenyScopeRequest404Response +type DenyScopeRequest404Response struct { + Errors *[]DenyScopeRequest404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/scopes/model_deny_scope_request_404_response_errors_inner.go b/rest/api/v3/scopes/model_deny_scope_request_404_response_errors_inner.go new file mode 100644 index 00000000..b2801e34 --- /dev/null +++ b/rest/api/v3/scopes/model_deny_scope_request_404_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DenyScopeRequest404ResponseErrorsInner struct for DenyScopeRequest404ResponseErrorsInner +type DenyScopeRequest404ResponseErrorsInner struct { + Message *string `json:"message,omitempty"` + Field *string `json:"field,omitempty"` +} diff --git a/rest/api/v3/scopes/model_error_response.go b/rest/api/v3/scopes/model_error_response.go new file mode 100644 index 00000000..4adefcdf --- /dev/null +++ b/rest/api/v3/scopes/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/scopes/model_error_response_errors_inner.go b/rest/api/v3/scopes/model_error_response_errors_inner.go new file mode 100644 index 00000000..de2012d0 --- /dev/null +++ b/rest/api/v3/scopes/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/scopes/model_list_scope_200_response.go b/rest/api/v3/scopes/model_list_scope_200_response.go new file mode 100644 index 00000000..f9c8775e --- /dev/null +++ b/rest/api/v3/scopes/model_list_scope_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListScope200Response struct for ListScope200Response +type ListScope200Response struct { + // The list of scopes for which this user has access. + Scopes []string `json:"scopes"` +} diff --git a/rest/api/v3/scopes/model_list_scope_401_response.go b/rest/api/v3/scopes/model_list_scope_401_response.go new file mode 100644 index 00000000..bb9109ba --- /dev/null +++ b/rest/api/v3/scopes/model_list_scope_401_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListScope401Response struct for ListScope401Response +type ListScope401Response struct { + // This 401 response indicates that the user making the call doesn't have the authorization to view the list of scopes. + Errors []ListScope401ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/scopes/model_list_scope_401_response_errors_inner.go b/rest/api/v3/scopes/model_list_scope_401_response_errors_inner.go new file mode 100644 index 00000000..82cec172 --- /dev/null +++ b/rest/api/v3/scopes/model_list_scope_401_response_errors_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListScope401ResponseErrorsInner struct for ListScope401ResponseErrorsInner +type ListScope401ResponseErrorsInner struct { + // This empty field is returned instead of the list of scopes if the user making the call doesn't have the authorization required. + Field *string `json:"field,omitempty"` + // Explains why the scopes cannot be returned. + Message string `json:"message"` +} diff --git a/rest/api/v3/scopes/model_list_scope_request_200_response_inner.go b/rest/api/v3/scopes/model_list_scope_request_200_response_inner.go new file mode 100644 index 00000000..5392887d --- /dev/null +++ b/rest/api/v3/scopes/model_list_scope_request_200_response_inner.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Scopes API +* The Twilio SendGrid Scopes API allows you to retrieve the scopes or permissions available to a user, see the user's attempts to access your SendGrid account, and, if necessary, deny an access request. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListScopeRequest200ResponseInner struct for ListScopeRequest200ResponseInner +type ListScopeRequest200ResponseInner struct { + // Request ID + Id *int32 `json:"id,omitempty"` + // Name of group of scopes associated to page teammate is requesting access to + ScopeGroupName *string `json:"scope_group_name,omitempty"` + // Teammate's username + Username *string `json:"username,omitempty"` + // Teammate's email + Email *string `json:"email,omitempty"` + // Teammate's first name + FirstName *string `json:"first_name,omitempty"` + // Teammate's last name + LastName *string `json:"last_name,omitempty"` +} diff --git a/rest/api/v3/seq/README.md b/rest/api/v3/seq/README.md new file mode 100644 index 00000000..0f4e4cb4 --- /dev/null +++ b/rest/api/v3/seq/README.md @@ -0,0 +1,71 @@ +# Go API client for + +The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. + +An SEQ score is correlated with: +- The quality of the data in a sender’s program. +- How “wanted” the sender's email is by their recipients. + +Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.378456+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ListEngagementQualityScore* | [**ListEngagementQualityScore**](docs/ListEngagementQualityScore.md#listengagementqualityscore) | **Get** /v3/engagementquality/scores | Get Engagement Quality Scores +*ListSubuserEngagementQualityScore* | [**ListSubuserEngagementQualityScore**](docs/ListSubuserEngagementQualityScore.md#listsubuserengagementqualityscore) | **Get** /v3/engagementquality/subusers/scores | Get Subusers' Engagement Quality Scores + + +## Documentation For Models + + - [SeqError](SeqError.md) + - [SeqMetadata](SeqMetadata.md) + - [SeqMetadataNextParams](SeqMetadataNextParams.md) + - [SeqMetrics](SeqMetrics.md) + - [SeqScore](SeqScore.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/seq/api_list_engagement_quality_score.go b/rest/api/v3/seq/api_list_engagement_quality_score.go new file mode 100644 index 00000000..878812db --- /dev/null +++ b/rest/api/v3/seq/api_list_engagement_quality_score.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "fmt" + "net/http" + "net/url" +) + +type ListEngagementQualityScoreParam struct { + // The starting date in YYYY-MM-DD format (UTC) for which you want to retrieve scores. + From *string `json:"from"` + // The ending date in YYYY-MM-DD format (UTC) for which you want to retrieve scores. + To *string `json:"to"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListEngagementQualityScoreParam) SetFrom(From string) *ListEngagementQualityScoreParam { + params.From = &From + return params +} +func (params *ListEngagementQualityScoreParam) SetTo(To string) *ListEngagementQualityScoreParam { + params.To = &To + return params +} +func (params *ListEngagementQualityScoreParam) SetOnbehalfof(Onbehalfof string) *ListEngagementQualityScoreParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This operation allows you to retrieve your SendGrid Engagement Quality (SEQ) scores for a specified date range**. A successful request with this API operation will return either a `200` or `202` response. ### 202 This operation returns a `202` response when SendGrid does not yet have scores available for the specified date range. Scores are calculated asynchronously from requests to this endpoint. This means a score may be available for the specified date at a later time, but a score is not available at the time of your API request. ### 200 A 200 response will include all available scores beginning on the `from` and ending on the `to` dates specified. The `score` and `metrics` properties will be omitted from the response for any days in which the user is not eligible to receive a score. The `score` property represents a user's overall engagement quality. The `metrics` property provides additional scores for the input categories that contribute to that overall score. All scores range from `1` to `5` with a higher number representing better engagement quality. See [**SendGrid Engagement Quality Overview**](https://docs.sendgrid.com/api-reference/sendgrid-engagement-quality-api/overview) for more information +func (c *ApiService) ListEngagementQualityScore(params *ListEngagementQualityScoreParam) (interface{}, error) { + path := "/v3/engagementquality/scores" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.From != nil { + data.Set("from", fmt.Sprint(*params.From)) + } + if params != nil && params.To != nil { + data.Set("to", fmt.Sprint(*params.To)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/seq/api_list_subuser_engagement_quality_score.go b/rest/api/v3/seq/api_list_subuser_engagement_quality_score.go new file mode 100644 index 00000000..8176b507 --- /dev/null +++ b/rest/api/v3/seq/api_list_subuser_engagement_quality_score.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "fmt" + "net/http" + "net/url" +) + +type ListSubuserEngagementQualityScoreParam struct { + // The date in YYYY-MM-DD format (UTC) for which you want to retrieve a SendGrid Engagement Quality score. + Date *string `json:"date"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // Specifies the number of results to be returned by the API. This parameter can be used to limit the results returned or in combination with the `after_key` parameter to iterate through paginated results. + Limit *int32 `json:"limit,omitempty"` + // Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. + AfterKey *int32 `json:"after_key,omitempty"` +} + +func (params *ListSubuserEngagementQualityScoreParam) SetDate(Date string) *ListSubuserEngagementQualityScoreParam { + params.Date = &Date + return params +} +func (params *ListSubuserEngagementQualityScoreParam) SetOnbehalfof(Onbehalfof string) *ListSubuserEngagementQualityScoreParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListSubuserEngagementQualityScoreParam) SetLimit(Limit int32) *ListSubuserEngagementQualityScoreParam { + params.Limit = &Limit + return params +} +func (params *ListSubuserEngagementQualityScoreParam) SetAfterKey(AfterKey int32) *ListSubuserEngagementQualityScoreParam { + params.AfterKey = &AfterKey + return params +} + +// **This operation allows you to retrieve SendGrid Engagement Quality (SEQ) scores for your Subusers or customer accounts for a specific date.** A successful request with this API operation will return either a `200` or `202` response. ### 202 This operation returns a `202` response when SendGrid does not yet have scores available for the specified date range. Scores are calculated asynchronously from requests to this endpoint. This means a score may be available for the specified date at a later time, but a score is not available at the time of your API request. ### 200 A `200` response will include scores for all Subusers or customer accounts belonging to the requesting parent or reseller account. The `score` and `metrics` properties will be omitted from the response if a Subuser or customer account is not eligible to receive a score for the specified date. The `score` property represents a Subuser or customer account's overall engagement quality. The `metrics` property provides additional scores for the input categories that contribute to that overall score. All scores range from `1` to `5` with a higher number representing better engagement quality. See [**SendGrid Engagement Quality Overview**](https://docs.sendgrid.com/api-reference/sendgrid-engagement-quality-api/overview) for more information +func (c *ApiService) ListSubuserEngagementQualityScore(params *ListSubuserEngagementQualityScoreParam) (interface{}, error) { + path := "/v3/engagementquality/subusers/scores" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Date != nil { + data.Set("date", fmt.Sprint(*params.Date)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.AfterKey != nil { + data.Set("after_key", fmt.Sprint(*params.AfterKey)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/seq/api_service.go b/rest/api/v3/seq/api_service.go new file mode 100644 index 00000000..5a7df229 --- /dev/null +++ b/rest/api/v3/seq/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/seq/docs/ListEngagementQualityScore.md b/rest/api/v3/seq/docs/ListEngagementQualityScore.md new file mode 100644 index 00000000..468dac7f --- /dev/null +++ b/rest/api/v3/seq/docs/ListEngagementQualityScore.md @@ -0,0 +1,48 @@ +# ListEngagementQualityScore + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListEngagementQualityScore**](ListEngagementQualityScore.md#ListEngagementQualityScore) | **Get** /v3/engagementquality/scores | Get Engagement Quality Scores + + + +## ListEngagementQualityScore + +> interface{} ListEngagementQualityScore(ctx, FromTooptional) + +Get Engagement Quality Scores + +**This operation allows you to retrieve your SendGrid Engagement Quality (SEQ) scores for a specified date range**. A successful request with this API operation will return either a `200` or `202` response. ### 202 This operation returns a `202` response when SendGrid does not yet have scores available for the specified date range. Scores are calculated asynchronously from requests to this endpoint. This means a score may be available for the specified date at a later time, but a score is not available at the time of your API request. ### 200 A 200 response will include all available scores beginning on the `from` and ending on the `to` dates specified. The `score` and `metrics` properties will be omitted from the response for any days in which the user is not eligible to receive a score. The `score` property represents a user's overall engagement quality. The `metrics` property provides additional scores for the input categories that contribute to that overall score. All scores range from `1` to `5` with a higher number representing better engagement quality. See [**SendGrid Engagement Quality Overview**](https://docs.sendgrid.com/api-reference/sendgrid-engagement-quality-api/overview) for more information + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListEngagementQualityScoreParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/seq/docs/ListSubuserEngagementQualityScore.md b/rest/api/v3/seq/docs/ListSubuserEngagementQualityScore.md new file mode 100644 index 00000000..7f22b452 --- /dev/null +++ b/rest/api/v3/seq/docs/ListSubuserEngagementQualityScore.md @@ -0,0 +1,50 @@ +# ListSubuserEngagementQualityScore + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSubuserEngagementQualityScore**](ListSubuserEngagementQualityScore.md#ListSubuserEngagementQualityScore) | **Get** /v3/engagementquality/subusers/scores | Get Subusers' Engagement Quality Scores + + + +## ListSubuserEngagementQualityScore + +> interface{} ListSubuserEngagementQualityScore(ctx, Dateoptional) + +Get Subusers' Engagement Quality Scores + +**This operation allows you to retrieve SendGrid Engagement Quality (SEQ) scores for your Subusers or customer accounts for a specific date.** A successful request with this API operation will return either a `200` or `202` response. ### 202 This operation returns a `202` response when SendGrid does not yet have scores available for the specified date range. Scores are calculated asynchronously from requests to this endpoint. This means a score may be available for the specified date at a later time, but a score is not available at the time of your API request. ### 200 A `200` response will include scores for all Subusers or customer accounts belonging to the requesting parent or reseller account. The `score` and `metrics` properties will be omitted from the response if a Subuser or customer account is not eligible to receive a score for the specified date. The `score` property represents a Subuser or customer account's overall engagement quality. The `metrics` property provides additional scores for the input categories that contribute to that overall score. All scores range from `1` to `5` with a higher number representing better engagement quality. See [**SendGrid Engagement Quality Overview**](https://docs.sendgrid.com/api-reference/sendgrid-engagement-quality-api/overview) for more information + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSubuserEngagementQualityScoreParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | Specifies the number of results to be returned by the API. This parameter can be used to limit the results returned or in combination with the `after_key` parameter to iterate through paginated results. +**AfterKey** | **int32** | Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results. + +### Return type + +**interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/seq/docs/SeqError.md b/rest/api/v3/seq/docs/SeqError.md new file mode 100644 index 00000000..a36145cf --- /dev/null +++ b/rest/api/v3/seq/docs/SeqError.md @@ -0,0 +1,12 @@ +# SeqError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Message** | **string** | An error message. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/seq/docs/SeqMetadata.md b/rest/api/v3/seq/docs/SeqMetadata.md new file mode 100644 index 00000000..f13d51d3 --- /dev/null +++ b/rest/api/v3/seq/docs/SeqMetadata.md @@ -0,0 +1,11 @@ +# SeqMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextParams** | [**SeqMetadataNextParams**](SeqMetadataNextParams.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/seq/docs/SeqMetadataNextParams.md b/rest/api/v3/seq/docs/SeqMetadataNextParams.md new file mode 100644 index 00000000..a361a0e5 --- /dev/null +++ b/rest/api/v3/seq/docs/SeqMetadataNextParams.md @@ -0,0 +1,11 @@ +# SeqMetadataNextParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AfterKey** | **string** | The `after_key` property represents the last processed key. If the `after_key` property is `null`, there are no more entries available. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/seq/docs/SeqMetrics.md b/rest/api/v3/seq/docs/SeqMetrics.md new file mode 100644 index 00000000..13404179 --- /dev/null +++ b/rest/api/v3/seq/docs/SeqMetrics.md @@ -0,0 +1,15 @@ +# SeqMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EngagementRecency** | **float32** | Indicates whether or not you are sending to an engaged audience. Engagement recency is determined by factors such as how regularly your messages are being opened and clicked. Your score will range from `1` to `5` with a higher score representing better engagement quality. | +**OpenRate** | **float32** | Indicates the degree to which your audience is opening your messages. Your score will range from `1` to `5` with a higher score representing a better open rate and better engagement quality. | +**BounceClassification** | **float32** | Indicates the degree to which mailbox providers are rejecting your mail due to reputation issues or content that looks like spam. Your score is calculated based on a ratio of these specific types of bounces to your total processed email. Your score will range from `1` to `5` with a higher score representing a lower percentage of bounces and better engagement quality. | +**BounceRate** | **float32** | Indicates if you are attempting to send too many messages to addresses that don't exist. This score is determined by calculating your permanent bounces (bounces to invalid mailboxes). Your score will range from `1` to `5` with a higher score representing fewer bounces and better engagement quality. | +**SpamRate** | **float32** | Indicates if your messages are generating excessive spam complaints from recipients. This score is determined by calculating the number of recipients who open your mail and then mark it as spam. Your score will range from `1` to `5` with a higher score representing fewer spam reports and better engagement quality. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/seq/docs/SeqScore.md b/rest/api/v3/seq/docs/SeqScore.md new file mode 100644 index 00000000..84b13574 --- /dev/null +++ b/rest/api/v3/seq/docs/SeqScore.md @@ -0,0 +1,15 @@ +# SeqScore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UserId** | **string** | The user identifier associated with this score. | +**Username** | **string** | The username associated with this score. |[optional] +**Date** | **string** | The date (UTC) for which this score was calculated. |[optional] +**Score** | **float32** | Your SendGrid Engagement Quality Score. The `score` property will be omitted when a score is unknown. A score may be unknown if you have not turned on [open tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking) and/or your account or Subuser has not sent at least 1,000 messages during the previous 30 days. |[optional] +**Metrics** | [**SeqMetrics**](SeqMetrics.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/seq/model_seq_error.go b/rest/api/v3/seq/model_seq_error.go new file mode 100644 index 00000000..1494de42 --- /dev/null +++ b/rest/api/v3/seq/model_seq_error.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SeqError This object contains error details +type SeqError struct { + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // An error message. + Message string `json:"message"` +} diff --git a/rest/api/v3/seq/model_seq_metadata.go b/rest/api/v3/seq/model_seq_metadata.go new file mode 100644 index 00000000..91510ac6 --- /dev/null +++ b/rest/api/v3/seq/model_seq_metadata.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SeqMetadata This object contains response metadata. The presence of the `after_key` property in the metadata indicates that some items are still outstanding and have not been retrieved. You can use the `after_key` value to retrieve additional items with another request. +type SeqMetadata struct { + NextParams *SeqMetadataNextParams `json:"next_params,omitempty"` +} diff --git a/rest/api/v3/seq/model_seq_metadata_next_params.go b/rest/api/v3/seq/model_seq_metadata_next_params.go new file mode 100644 index 00000000..0016951c --- /dev/null +++ b/rest/api/v3/seq/model_seq_metadata_next_params.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SeqMetadataNextParams struct for SeqMetadataNextParams +type SeqMetadataNextParams struct { + // The `after_key` property represents the last processed key. If the `after_key` property is `null`, there are no more entries available. + AfterKey *string `json:"after_key,omitempty"` +} diff --git a/rest/api/v3/seq/model_seq_metrics.go b/rest/api/v3/seq/model_seq_metrics.go new file mode 100644 index 00000000..21ef4bb5 --- /dev/null +++ b/rest/api/v3/seq/model_seq_metrics.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SeqMetrics A collection of metrics representing your engagement score across multiple indicators such as your open rate, spam rate, and bounce rate. Each metric is assigned a score from `1` to `5` with a higher score representing better engagement quality for that particular metric. The `metrics` property will be omitted when a score is unknown. A score may be unknown if you have not turned on [open tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking) and/or your account or Subuser has not sent at least 1,000 messages during the previous 30 days. +type SeqMetrics struct { + // Indicates whether or not you are sending to an engaged audience. Engagement recency is determined by factors such as how regularly your messages are being opened and clicked. Your score will range from `1` to `5` with a higher score representing better engagement quality. + EngagementRecency float32 `json:"engagement_recency"` + // Indicates the degree to which your audience is opening your messages. Your score will range from `1` to `5` with a higher score representing a better open rate and better engagement quality. + OpenRate float32 `json:"open_rate"` + // Indicates the degree to which mailbox providers are rejecting your mail due to reputation issues or content that looks like spam. Your score is calculated based on a ratio of these specific types of bounces to your total processed email. Your score will range from `1` to `5` with a higher score representing a lower percentage of bounces and better engagement quality. + BounceClassification float32 `json:"bounce_classification"` + // Indicates if you are attempting to send too many messages to addresses that don't exist. This score is determined by calculating your permanent bounces (bounces to invalid mailboxes). Your score will range from `1` to `5` with a higher score representing fewer bounces and better engagement quality. + BounceRate float32 `json:"bounce_rate"` + // Indicates if your messages are generating excessive spam complaints from recipients. This score is determined by calculating the number of recipients who open your mail and then mark it as spam. Your score will range from `1` to `5` with a higher score representing fewer spam reports and better engagement quality. + SpamRate float32 `json:"spam_rate"` +} diff --git a/rest/api/v3/seq/model_seq_score.go b/rest/api/v3/seq/model_seq_score.go new file mode 100644 index 00000000..04818407 --- /dev/null +++ b/rest/api/v3/seq/model_seq_score.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Engagement Quality API +* The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program. An SEQ score is correlated with: - The quality of the data in a sender’s program. - How “wanted” the sender's email is by their recipients. Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SeqScore A user's SendGrid Engagement Quality (SEQ) score for a specified date. Your SEQ score is determined by measuring several key metrics including your open rate, spam rate, and engagement recency. Your overall score allows you to quickly assess how your email program is performing at a high level. You will receive a score from `1` to `5` with a higher number representing better engagement quality. See the `metrics` property to understand how your program is performing across the input categories that determine your overall score. +type SeqScore struct { + // The user identifier associated with this score. + UserId string `json:"user_id"` + // The username associated with this score. + Username *string `json:"username,omitempty"` + // The date (UTC) for which this score was calculated. + Date *string `json:"date,omitempty"` + // Your SendGrid Engagement Quality Score. The `score` property will be omitted when a score is unknown. A score may be unknown if you have not turned on [open tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking) and/or your account or Subuser has not sent at least 1,000 messages during the previous 30 days. + Score *float32 `json:"score,omitempty"` + Metrics *SeqMetrics `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/sso/README.md b/rest/api/v3/sso/README.md new file mode 100644 index 00000000..f754ac08 --- /dev/null +++ b/rest/api/v3/sso/README.md @@ -0,0 +1,94 @@ +# Go API client for + +The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). + +The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. + +The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. + +The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.408909+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateSsoCertificate* | [**CreateSsoCertificate**](docs/CreateSsoCertificate.md#createssocertificate) | **Post** /v3/sso/certificates | Create an SSO Certificate +*CreateSsoIntegration* | [**CreateSsoIntegration**](docs/CreateSsoIntegration.md#createssointegration) | **Post** /v3/sso/integrations | Create an SSO Integration +*CreateSsoTeammate* | [**CreateSsoTeammate**](docs/CreateSsoTeammate.md#createssoteammate) | **Post** /v3/sso/teammates | Create an SSO Teammate. +*DeleteSsoCertificate* | [**DeleteSsoCertificate**](docs/DeleteSsoCertificate.md#deletessocertificate) | **Delete** /v3/sso/certificates/{CertId} | Delete an SSO Certificate +*DeleteSsoIntegration* | [**DeleteSsoIntegration**](docs/DeleteSsoIntegration.md#deletessointegration) | **Delete** /v3/sso/integrations/{Id} | Delete an SSO Integration +*GetSsoCertificate* | [**GetSsoCertificate**](docs/GetSsoCertificate.md#getssocertificate) | **Get** /v3/sso/certificates/{CertId} | Get an SSO Certificate +*GetSsoIntegration* | [**GetSsoIntegration**](docs/GetSsoIntegration.md#getssointegration) | **Get** /v3/sso/integrations/{Id} | Get an SSO Integration +*ListSsoIntegration* | [**ListSsoIntegration**](docs/ListSsoIntegration.md#listssointegration) | **Get** /v3/sso/integrations | Get All SSO Integrations +*ListSsoIntegrationCertificate* | [**ListSsoIntegrationCertificate**](docs/ListSsoIntegrationCertificate.md#listssointegrationcertificate) | **Get** /v3/sso/integrations/{IntegrationId}/certificates | Get All SSO Certificates by Integration +*UpdateSsoCertificate* | [**UpdateSsoCertificate**](docs/UpdateSsoCertificate.md#updatessocertificate) | **Patch** /v3/sso/certificates/{CertId} | Update SSO Certificate +*UpdateSsoIntegration* | [**UpdateSsoIntegration**](docs/UpdateSsoIntegration.md#updatessointegration) | **Patch** /v3/sso/integrations/{Id} | Update an SSO Integration +*UpdateSsoTeammate* | [**UpdateSsoTeammate**](docs/UpdateSsoTeammate.md#updatessoteammate) | **Patch** /v3/sso/teammates/{Username} | Edit an SSO Teammate + + +## Documentation For Models + + - [CreateSsoCertificateRequest](CreateSsoCertificateRequest.md) + - [PatchSsoTeammates200](PatchSsoTeammates200.md) + - [PermissionType](PermissionType.md) + - [PermissionType1](PermissionType1.md) + - [Persona](Persona.md) + - [PostPatchIntegrationRequest](PostPatchIntegrationRequest.md) + - [PostSsoTeammates201](PostSsoTeammates201.md) + - [PostSsoTeammatesRequest](PostSsoTeammatesRequest.md) + - [SsoCertificateBody](SsoCertificateBody.md) + - [SsoErrorResponseInner](SsoErrorResponseInner.md) + - [SsoIntegration](SsoIntegration.md) + - [SsoTeammatesBaseRequestProps](SsoTeammatesBaseRequestProps.md) + - [SsoTeammatesBaseRequestPropsSubuserAccessInner](SsoTeammatesBaseRequestPropsSubuserAccessInner.md) + - [SsoTeammatesBaseResponseProps](SsoTeammatesBaseResponseProps.md) + - [SsoTeammatesRestrictedSubuserResponseProps](SsoTeammatesRestrictedSubuserResponseProps.md) + - [SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) + - [UpdateSsoCertificateRequest](UpdateSsoCertificateRequest.md) + - [UserType](UserType.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/sso/api_create_sso_certificate.go b/rest/api/v3/sso/api_create_sso_certificate.go new file mode 100644 index 00000000..93f844de --- /dev/null +++ b/rest/api/v3/sso/api_create_sso_certificate.go @@ -0,0 +1,105 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSsoCertificateParam struct { + // + CreateSsoCertificateRequest *CreateSsoCertificateRequest `json:"CreateSsoCertificateRequest,omitempty"` +} + +func (params *CreateSsoCertificateParam) SetCreateSsoCertificateRequest(CreateSsoCertificateRequest CreateSsoCertificateRequest) *CreateSsoCertificateParam { + params.CreateSsoCertificateRequest = &CreateSsoCertificateRequest + return params +} + +// **This endpoint allows you to create an SSO certificate.** +func (c *ApiService) CreateSsoCertificate(params *CreateSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateSsoCertificateRequest != nil { + b, err := json.Marshal(*params.CreateSsoCertificateRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_create_sso_integration.go b/rest/api/v3/sso/api_create_sso_integration.go new file mode 100644 index 00000000..8544aa17 --- /dev/null +++ b/rest/api/v3/sso/api_create_sso_integration.go @@ -0,0 +1,105 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSsoIntegrationParam struct { + // + PostPatchIntegrationRequest *PostPatchIntegrationRequest `json:"PostPatchIntegrationRequest,omitempty"` +} + +func (params *CreateSsoIntegrationParam) SetPostPatchIntegrationRequest(PostPatchIntegrationRequest PostPatchIntegrationRequest) *CreateSsoIntegrationParam { + params.PostPatchIntegrationRequest = &PostPatchIntegrationRequest + return params +} + +// **This endpoint allows you to create an SSO integration.** +func (c *ApiService) CreateSsoIntegration(params *CreateSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.PostPatchIntegrationRequest != nil { + b, err := json.Marshal(*params.PostPatchIntegrationRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_create_sso_teammate.go b/rest/api/v3/sso/api_create_sso_teammate.go new file mode 100644 index 00000000..ae49f75c --- /dev/null +++ b/rest/api/v3/sso/api_create_sso_teammate.go @@ -0,0 +1,105 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSsoTeammateParam struct { + // + PostSsoTeammatesRequest *PostSsoTeammatesRequest `json:"PostSsoTeammatesRequest,omitempty"` +} + +func (params *CreateSsoTeammateParam) SetPostSsoTeammatesRequest(PostSsoTeammatesRequest PostSsoTeammatesRequest) *CreateSsoTeammateParam { + params.PostSsoTeammatesRequest = &PostSsoTeammatesRequest + return params +} + +// **This endpoint allows you to create an SSO Teammate.** The email address provided for the Teammate will also function as the Teammate's username. Once created, the Teammate's email address cannot be changed. ### Scopes When creating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. +func (c *ApiService) CreateSsoTeammate(params *CreateSsoTeammateParam) (interface{}, error) { + path := "/v3/sso/teammates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.PostSsoTeammatesRequest != nil { + b, err := json.Marshal(*params.PostSsoTeammatesRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &PostSsoTeammates201{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_delete_sso_certificate.go b/rest/api/v3/sso/api_delete_sso_certificate.go new file mode 100644 index 00000000..d47bc8a3 --- /dev/null +++ b/rest/api/v3/sso/api_delete_sso_certificate.go @@ -0,0 +1,101 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteSsoCertificateParam struct { + // + CertId *string `json:"cert_id"` +} + +func (params *DeleteSsoCertificateParam) SetCertId(CertId string) *DeleteSsoCertificateParam { + params.CertId = &CertId + return params +} + +// **This endpoint allows you to delete an SSO certificate.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) DeleteSsoCertificate(params *DeleteSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates/{CertId}" + if params != nil && params.CertId != nil { + path = strings.Replace(path, "{"+"CertId"+"}", *params.CertId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_delete_sso_integration.go b/rest/api/v3/sso/api_delete_sso_integration.go new file mode 100644 index 00000000..5ecefab4 --- /dev/null +++ b/rest/api/v3/sso/api_delete_sso_integration.go @@ -0,0 +1,93 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteSsoIntegrationParam struct { + // + Id *string `json:"id"` +} + +func (params *DeleteSsoIntegrationParam) SetId(Id string) *DeleteSsoIntegrationParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to delete an IdP configuration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) DeleteSsoIntegration(params *DeleteSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_get_sso_certificate.go b/rest/api/v3/sso/api_get_sso_certificate.go new file mode 100644 index 00000000..cc1c9ee0 --- /dev/null +++ b/rest/api/v3/sso/api_get_sso_certificate.go @@ -0,0 +1,101 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetSsoCertificateParam struct { + // + CertId *string `json:"cert_id"` +} + +func (params *GetSsoCertificateParam) SetCertId(CertId string) *GetSsoCertificateParam { + params.CertId = &CertId + return params +} + +// **This endpoint allows you to retrieve an individual SSO certificate.** +func (c *ApiService) GetSsoCertificate(params *GetSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates/{CertId}" + if params != nil && params.CertId != nil { + path = strings.Replace(path, "{"+"CertId"+"}", *params.CertId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_get_sso_integration.go b/rest/api/v3/sso/api_get_sso_integration.go new file mode 100644 index 00000000..69b10522 --- /dev/null +++ b/rest/api/v3/sso/api_get_sso_integration.go @@ -0,0 +1,112 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetSsoIntegrationParam struct { + // + Id *string `json:"id"` + // If this parameter is set to `true`, the response will include the `completed_integration` field. + Si *bool `json:"si,omitempty"` +} + +func (params *GetSsoIntegrationParam) SetId(Id string) *GetSsoIntegrationParam { + params.Id = &Id + return params +} +func (params *GetSsoIntegrationParam) SetSi(Si bool) *GetSsoIntegrationParam { + params.Si = &Si + return params +} + +// **This endpoint allows you to retrieve an SSO integration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) GetSsoIntegration(params *GetSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Si != nil { + data.Set("si", fmt.Sprint(*params.Si)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_list_sso_integration.go b/rest/api/v3/sso/api_list_sso_integration.go new file mode 100644 index 00000000..45ae2724 --- /dev/null +++ b/rest/api/v3/sso/api_list_sso_integration.go @@ -0,0 +1,101 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListSsoIntegrationParam struct { + // If this parameter is set to `true`, the response will include the `completed_integration` field. + Si *bool `json:"si,omitempty"` +} + +func (params *ListSsoIntegrationParam) SetSi(Si bool) *ListSsoIntegrationParam { + params.Si = &Si + return params +} + +// **This endpoint allows you to retrieve all SSO integrations tied to your Twilio SendGrid account.** The IDs returned by this endpoint can be used by the APIs additional endpoints to modify your SSO integrations. +func (c *ApiService) ListSsoIntegration(params *ListSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Si != nil { + data.Set("si", fmt.Sprint(*params.Si)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_list_sso_integration_certificate.go b/rest/api/v3/sso/api_list_sso_integration_certificate.go new file mode 100644 index 00000000..716201f5 --- /dev/null +++ b/rest/api/v3/sso/api_list_sso_integration_certificate.go @@ -0,0 +1,101 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ListSsoIntegrationCertificateParam struct { + // An ID that matches a certificate to a specific IdP integration. + IntegrationId *string `json:"integration_id"` +} + +func (params *ListSsoIntegrationCertificateParam) SetIntegrationId(IntegrationId string) *ListSsoIntegrationCertificateParam { + params.IntegrationId = &IntegrationId + return params +} + +// **This endpoint allows you to retrieve all your IdP configurations by configuration ID.** The `integration_id` expected by this endpoint is the `id` returned in the response by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) ListSsoIntegrationCertificate(params *ListSsoIntegrationCertificateParam) (interface{}, error) { + path := "/v3/sso/integrations/{IntegrationId}/certificates" + if params != nil && params.IntegrationId != nil { + path = strings.Replace(path, "{"+"IntegrationId"+"}", *params.IntegrationId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_service.go b/rest/api/v3/sso/api_service.go new file mode 100644 index 00000000..1564dab4 --- /dev/null +++ b/rest/api/v3/sso/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/sso/api_update_sso_certificate.go b/rest/api/v3/sso/api_update_sso_certificate.go new file mode 100644 index 00000000..f06da50e --- /dev/null +++ b/rest/api/v3/sso/api_update_sso_certificate.go @@ -0,0 +1,116 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSsoCertificateParam struct { + // + CertId *string `json:"cert_id"` + // + UpdateSsoCertificateRequest *UpdateSsoCertificateRequest `json:"UpdateSsoCertificateRequest,omitempty"` +} + +func (params *UpdateSsoCertificateParam) SetCertId(CertId string) *UpdateSsoCertificateParam { + params.CertId = &CertId + return params +} +func (params *UpdateSsoCertificateParam) SetUpdateSsoCertificateRequest(UpdateSsoCertificateRequest UpdateSsoCertificateRequest) *UpdateSsoCertificateParam { + params.UpdateSsoCertificateRequest = &UpdateSsoCertificateRequest + return params +} + +// **This endpoint allows you to update an existing certificate by ID.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) UpdateSsoCertificate(params *UpdateSsoCertificateParam) (interface{}, error) { + path := "/v3/sso/certificates/{CertId}" + if params != nil && params.CertId != nil { + path = strings.Replace(path, "{"+"CertId"+"}", *params.CertId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateSsoCertificateRequest != nil { + b, err := json.Marshal(*params.UpdateSsoCertificateRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoCertificateBody{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_update_sso_integration.go b/rest/api/v3/sso/api_update_sso_integration.go new file mode 100644 index 00000000..f5a8415b --- /dev/null +++ b/rest/api/v3/sso/api_update_sso_integration.go @@ -0,0 +1,126 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type UpdateSsoIntegrationParam struct { + // + Id *string `json:"id"` + // If this parameter is set to `true`, the response will include the `completed_integration` field. + Si *bool `json:"si,omitempty"` + // + PostPatchIntegrationRequest *PostPatchIntegrationRequest `json:"PostPatchIntegrationRequest,omitempty"` +} + +func (params *UpdateSsoIntegrationParam) SetId(Id string) *UpdateSsoIntegrationParam { + params.Id = &Id + return params +} +func (params *UpdateSsoIntegrationParam) SetSi(Si bool) *UpdateSsoIntegrationParam { + params.Si = &Si + return params +} +func (params *UpdateSsoIntegrationParam) SetPostPatchIntegrationRequest(PostPatchIntegrationRequest PostPatchIntegrationRequest) *UpdateSsoIntegrationParam { + params.PostPatchIntegrationRequest = &PostPatchIntegrationRequest + return params +} + +// **This endpoint allows you to modify an exisiting SSO integration.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. +func (c *ApiService) UpdateSsoIntegration(params *UpdateSsoIntegrationParam) (interface{}, error) { + path := "/v3/sso/integrations/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + if params != nil && params.Si != nil { + data.Set("si", fmt.Sprint(*params.Si)) + } + body := []byte{} + if params != nil && params.PostPatchIntegrationRequest != nil { + b, err := json.Marshal(*params.PostPatchIntegrationRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SsoIntegration{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/api_update_sso_teammate.go b/rest/api/v3/sso/api_update_sso_teammate.go new file mode 100644 index 00000000..ded4c5ba --- /dev/null +++ b/rest/api/v3/sso/api_update_sso_teammate.go @@ -0,0 +1,116 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSsoTeammateParam struct { + // Set this parameter to the Teammate's email address. This address must be the same address assigned to the Teammate in your IdP. + Username *string `json:"username"` + // + Body *SsoTeammatesBaseRequestProps `json:"body,omitempty"` +} + +func (params *UpdateSsoTeammateParam) SetUsername(Username string) *UpdateSsoTeammateParam { + params.Username = &Username + return params +} +func (params *UpdateSsoTeammateParam) SetBody(Body SsoTeammatesBaseRequestProps) *UpdateSsoTeammateParam { + params.Body = &Body + return params +} + +// **This endpoint allows you to modify an existing SSO Teammate.** Only the parent user and Teammates with admin permissions can update another Teammate's permissions. ### Scopes When updating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. +func (c *ApiService) UpdateSsoTeammate(params *UpdateSsoTeammateParam) (interface{}, error) { + path := "/v3/sso/teammates/{Username}" + if params != nil && params.Username != nil { + path = strings.Replace(path, "{"+"Username"+"}", *params.Username, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.Body != nil { + b, err := json.Marshal(*params.Body) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &PatchSsoTeammates200{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 429 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &[]SsoErrorResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/sso/docs/CreateSsoCertificate.md b/rest/api/v3/sso/docs/CreateSsoCertificate.md new file mode 100644 index 00000000..0f1b57e1 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoCertificate.md @@ -0,0 +1,48 @@ +# CreateSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSsoCertificate**](CreateSsoCertificate.md#CreateSsoCertificate) | **Post** /v3/sso/certificates | Create an SSO Certificate + + + +## CreateSsoCertificate + +> SsoCertificateBody CreateSsoCertificate(ctx, optional) + +Create an SSO Certificate + +**This endpoint allows you to create an SSO certificate.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**CreateSsoCertificateRequest** | [**CreateSsoCertificateRequest**](CreateSsoCertificateRequest.md) | + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/CreateSsoCertificateRequest.md b/rest/api/v3/sso/docs/CreateSsoCertificateRequest.md new file mode 100644 index 00000000..ff047454 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoCertificateRequest.md @@ -0,0 +1,13 @@ +# CreateSsoCertificateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PublicCertificate** | **string** | This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. | +**Enabled** | **bool** | Indicates if the certificate is enabled. |[optional] +**IntegrationId** | **string** | An ID that matches a certificate to a specific IdP integration. This is the `id` returned by the \"Get All SSO Integrations\" endpoint. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/CreateSsoIntegration.md b/rest/api/v3/sso/docs/CreateSsoIntegration.md new file mode 100644 index 00000000..cc6926e3 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoIntegration.md @@ -0,0 +1,48 @@ +# CreateSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSsoIntegration**](CreateSsoIntegration.md#CreateSsoIntegration) | **Post** /v3/sso/integrations | Create an SSO Integration + + + +## CreateSsoIntegration + +> SsoIntegration CreateSsoIntegration(ctx, optional) + +Create an SSO Integration + +**This endpoint allows you to create an SSO integration.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PostPatchIntegrationRequest** | [**PostPatchIntegrationRequest**](PostPatchIntegrationRequest.md) | + +### Return type + +[**SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/CreateSsoTeammate.md b/rest/api/v3/sso/docs/CreateSsoTeammate.md new file mode 100644 index 00000000..98907b69 --- /dev/null +++ b/rest/api/v3/sso/docs/CreateSsoTeammate.md @@ -0,0 +1,48 @@ +# CreateSsoTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSsoTeammate**](CreateSsoTeammate.md#CreateSsoTeammate) | **Post** /v3/sso/teammates | Create an SSO Teammate. + + + +## CreateSsoTeammate + +> PostSsoTeammates201 CreateSsoTeammate(ctx, optional) + +Create an SSO Teammate. + +**This endpoint allows you to create an SSO Teammate.** The email address provided for the Teammate will also function as the Teammate's username. Once created, the Teammate's email address cannot be changed. ### Scopes When creating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSsoTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**PostSsoTeammatesRequest** | [**PostSsoTeammatesRequest**](PostSsoTeammatesRequest.md) | + +### Return type + +[**PostSsoTeammates201**](PostSsoTeammates201.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/DeleteSsoCertificate.md b/rest/api/v3/sso/docs/DeleteSsoCertificate.md new file mode 100644 index 00000000..27eba6d0 --- /dev/null +++ b/rest/api/v3/sso/docs/DeleteSsoCertificate.md @@ -0,0 +1,51 @@ +# DeleteSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSsoCertificate**](DeleteSsoCertificate.md#DeleteSsoCertificate) | **Delete** /v3/sso/certificates/{CertId} | Delete an SSO Certificate + + + +## DeleteSsoCertificate + +> SsoCertificateBody DeleteSsoCertificate(ctx, CertId) + +Delete an SSO Certificate + +**This endpoint allows you to delete an SSO certificate.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CertId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/DeleteSsoIntegration.md b/rest/api/v3/sso/docs/DeleteSsoIntegration.md new file mode 100644 index 00000000..d9961b65 --- /dev/null +++ b/rest/api/v3/sso/docs/DeleteSsoIntegration.md @@ -0,0 +1,51 @@ +# DeleteSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSsoIntegration**](DeleteSsoIntegration.md#DeleteSsoIntegration) | **Delete** /v3/sso/integrations/{Id} | Delete an SSO Integration + + + +## DeleteSsoIntegration + +> DeleteSsoIntegration(ctx, Id) + +Delete an SSO Integration + +**This endpoint allows you to delete an IdP configuration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/GetSsoCertificate.md b/rest/api/v3/sso/docs/GetSsoCertificate.md new file mode 100644 index 00000000..e6ecfde7 --- /dev/null +++ b/rest/api/v3/sso/docs/GetSsoCertificate.md @@ -0,0 +1,51 @@ +# GetSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSsoCertificate**](GetSsoCertificate.md#GetSsoCertificate) | **Get** /v3/sso/certificates/{CertId} | Get an SSO Certificate + + + +## GetSsoCertificate + +> SsoCertificateBody GetSsoCertificate(ctx, CertId) + +Get an SSO Certificate + +**This endpoint allows you to retrieve an individual SSO certificate.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CertId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/GetSsoIntegration.md b/rest/api/v3/sso/docs/GetSsoIntegration.md new file mode 100644 index 00000000..ea49cd71 --- /dev/null +++ b/rest/api/v3/sso/docs/GetSsoIntegration.md @@ -0,0 +1,52 @@ +# GetSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSsoIntegration**](GetSsoIntegration.md#GetSsoIntegration) | **Get** /v3/sso/integrations/{Id} | Get an SSO Integration + + + +## GetSsoIntegration + +> SsoIntegration GetSsoIntegration(ctx, Idoptional) + +Get an SSO Integration + +**This endpoint allows you to retrieve an SSO integration by ID.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Si** | **bool** | If this parameter is set to `true`, the response will include the `completed_integration` field. + +### Return type + +[**SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/ListSsoIntegration.md b/rest/api/v3/sso/docs/ListSsoIntegration.md new file mode 100644 index 00000000..8082cbe7 --- /dev/null +++ b/rest/api/v3/sso/docs/ListSsoIntegration.md @@ -0,0 +1,48 @@ +# ListSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSsoIntegration**](ListSsoIntegration.md#ListSsoIntegration) | **Get** /v3/sso/integrations | Get All SSO Integrations + + + +## ListSsoIntegration + +> []SsoIntegration ListSsoIntegration(ctx, optional) + +Get All SSO Integrations + +**This endpoint allows you to retrieve all SSO integrations tied to your Twilio SendGrid account.** The IDs returned by this endpoint can be used by the APIs additional endpoints to modify your SSO integrations. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Si** | **bool** | If this parameter is set to `true`, the response will include the `completed_integration` field. + +### Return type + +[**[]SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/ListSsoIntegrationCertificate.md b/rest/api/v3/sso/docs/ListSsoIntegrationCertificate.md new file mode 100644 index 00000000..526ad85d --- /dev/null +++ b/rest/api/v3/sso/docs/ListSsoIntegrationCertificate.md @@ -0,0 +1,51 @@ +# ListSsoIntegrationCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSsoIntegrationCertificate**](ListSsoIntegrationCertificate.md#ListSsoIntegrationCertificate) | **Get** /v3/sso/integrations/{IntegrationId}/certificates | Get All SSO Certificates by Integration + + + +## ListSsoIntegrationCertificate + +> []SsoCertificateBody ListSsoIntegrationCertificate(ctx, IntegrationId) + +Get All SSO Certificates by Integration + +**This endpoint allows you to retrieve all your IdP configurations by configuration ID.** The `integration_id` expected by this endpoint is the `id` returned in the response by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**IntegrationId** | **string** | An ID that matches a certificate to a specific IdP integration. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSsoIntegrationCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**[]SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/PatchSsoTeammates200.md b/rest/api/v3/sso/docs/PatchSsoTeammates200.md new file mode 100644 index 00000000..b1b277d5 --- /dev/null +++ b/rest/api/v3/sso/docs/PatchSsoTeammates200.md @@ -0,0 +1,29 @@ +# PatchSsoTeammates200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | The Teammate's street address. |[optional] +**Address2** | **string** | The Teammate's apartment number, suite number, or other secondary address information that is not part of the physical street address. |[optional] +**City** | **string** | The Teammate's city. |[optional] +**Company** | **string** | The Teammate's company name. |[optional] +**Country** | **string** | The Teammate's country of residence. |[optional] +**Username** | **string** | The Teammate's username. This property is set to the Teammate's email address. |[optional] +**Phone** | **string** | The Teammate's phone number. |[optional] +**State** | **string** | The Teammate's state or province. |[optional] +**UserType** | [**UserType**](UserType.md) | A Teammate can be an `admin`, `owner`, or `teammate`. Each role is associated with the scope of the Teammate's permissions. |[optional] +**Website** | **string** | A website associated with the Teammate. |[optional] +**Zip** | **string** | The Teammate's zip code. |[optional] +**FirstName** | **string** | The Teammate's first name. |[optional] +**LastName** | **string** | The Teammate's last name. |[optional] +**Email** | **string** | Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. |[optional] +**IsAdmin** | **bool** | Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. |[optional] +**IsSso** | **bool** | Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. |[optional] +**Scopes** | **[]string** | The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] +**HasRestrictedSubuserAccess** | **bool** | When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. |[optional] +**SubuserAccess** | [**[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner**](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) | Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/PermissionType.md b/rest/api/v3/sso/docs/PermissionType.md new file mode 100644 index 00000000..da44f853 --- /dev/null +++ b/rest/api/v3/sso/docs/PermissionType.md @@ -0,0 +1,13 @@ +# PermissionType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**RESTRICTED** | string | (value: `"restricted"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/PermissionType1.md b/rest/api/v3/sso/docs/PermissionType1.md new file mode 100644 index 00000000..5fa3bbb8 --- /dev/null +++ b/rest/api/v3/sso/docs/PermissionType1.md @@ -0,0 +1,13 @@ +# PermissionType1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**RESTRICTED** | string | (value: `"restricted"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/Persona.md b/rest/api/v3/sso/docs/Persona.md new file mode 100644 index 00000000..a422b3d2 --- /dev/null +++ b/rest/api/v3/sso/docs/Persona.md @@ -0,0 +1,15 @@ +# Persona + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ACCOUNTANT** | string | (value: `"accountant"`) +**DEVELOPER** | string | (value: `"developer"`) +**MARKETER** | string | (value: `"marketer"`) +**OBSERVER** | string | (value: `"observer"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/PostPatchIntegrationRequest.md b/rest/api/v3/sso/docs/PostPatchIntegrationRequest.md new file mode 100644 index 00000000..813db37b --- /dev/null +++ b/rest/api/v3/sso/docs/PostPatchIntegrationRequest.md @@ -0,0 +1,16 @@ +# PostPatchIntegrationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) | +**Enabled** | **bool** | Indicates if the integration is enabled. | +**SigninUrl** | **string** | The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. | +**SignoutUrl** | **string** | This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. | +**EntityId** | **string** | An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. | +**CompletedIntegration** | **bool** | Indicates if the integration is complete. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/PostSsoTeammates201.md b/rest/api/v3/sso/docs/PostSsoTeammates201.md new file mode 100644 index 00000000..90d13d83 --- /dev/null +++ b/rest/api/v3/sso/docs/PostSsoTeammates201.md @@ -0,0 +1,18 @@ +# PostSsoTeammates201 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | The Teammate's first name. |[optional] +**LastName** | **string** | The Teammate's last name. |[optional] +**Email** | **string** | Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. |[optional] +**IsAdmin** | **bool** | Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. |[optional] +**IsSso** | **bool** | Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. |[optional] +**Scopes** | **[]string** | The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] +**HasRestrictedSubuserAccess** | **bool** | When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. |[optional] +**SubuserAccess** | [**[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner**](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) | Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/PostSsoTeammatesRequest.md b/rest/api/v3/sso/docs/PostSsoTeammatesRequest.md new file mode 100644 index 00000000..ef110ee3 --- /dev/null +++ b/rest/api/v3/sso/docs/PostSsoTeammatesRequest.md @@ -0,0 +1,18 @@ +# PostSsoTeammatesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | Set this property to the Teammate's email address. This email address will also function as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. | +**FirstName** | **string** | Set this property to the Teammate's first name. | +**LastName** | **string** | Set this property to the Teammate's last name. | +**IsAdmin** | **bool** | Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. |[optional] +**Persona** | [**Persona**](Persona.md) | A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. |[optional] +**Scopes** | **[]string** | Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. |[optional] +**HasRestrictedSubuserAccess** | **bool** | Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. |[optional] +**SubuserAccess** | [**[]SsoTeammatesBaseRequestPropsSubuserAccessInner**](SsoTeammatesBaseRequestPropsSubuserAccessInner.md) | Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoCertificateBody.md b/rest/api/v3/sso/docs/SsoCertificateBody.md new file mode 100644 index 00000000..68cb6289 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoCertificateBody.md @@ -0,0 +1,15 @@ +# SsoCertificateBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PublicCertificate** | **string** | This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI. |[optional] +**Id** | **float32** | A unique ID assigned to the certificate by SendGrid. |[optional] +**NotBefore** | **float32** | A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid. |[optional] +**NotAfter** | **float32** | A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid. |[optional] +**IntergrationId** | **string** | An ID that matches a certificate to a specific IdP integration. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoErrorResponseInner.md b/rest/api/v3/sso/docs/SsoErrorResponseInner.md new file mode 100644 index 00000000..df959452 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoErrorResponseInner.md @@ -0,0 +1,13 @@ +# SsoErrorResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**Field** | **string** | |[optional] +**ErrorId** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoIntegration.md b/rest/api/v3/sso/docs/SsoIntegration.md new file mode 100644 index 00000000..aa5f45f8 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoIntegration.md @@ -0,0 +1,20 @@ +# SsoIntegration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) | +**Enabled** | **bool** | Indicates if the integration is enabled. | +**SigninUrl** | **string** | The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. | +**SignoutUrl** | **string** | This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. | +**EntityId** | **string** | An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. | +**CompletedIntegration** | **bool** | Indicates if the integration is complete. |[optional] +**LastUpdated** | **float32** | A timestamp representing the last time the configuration was modified. | +**Id** | **string** | A unique ID assigned to the configuration by SendGrid. |[optional] +**SingleSignonUrl** | **string** | The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using SendGrid. |[optional] +**AudienceUrl** | **string** | The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using SendGrid. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoTeammatesBaseRequestProps.md b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestProps.md new file mode 100644 index 00000000..fcededd9 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestProps.md @@ -0,0 +1,17 @@ +# SsoTeammatesBaseRequestProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | Set this property to the Teammate's first name. | +**LastName** | **string** | Set this property to the Teammate's last name. | +**IsAdmin** | **bool** | Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. |[optional] +**Persona** | [**Persona**](Persona.md) | A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. |[optional] +**Scopes** | **[]string** | Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. |[optional] +**HasRestrictedSubuserAccess** | **bool** | Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. |[optional] +**SubuserAccess** | [**[]SsoTeammatesBaseRequestPropsSubuserAccessInner**](SsoTeammatesBaseRequestPropsSubuserAccessInner.md) | Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md new file mode 100644 index 00000000..80c452b4 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesBaseRequestPropsSubuserAccessInner.md @@ -0,0 +1,13 @@ +# SsoTeammatesBaseRequestPropsSubuserAccessInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | Set this property to the ID of a Subuser to which the Teammate should have access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). | +**PermissionType** | [**PermissionType**](PermissionType.md) | Grant the level of access the Teammate should have to the specified Subuser with this property. This property value may be either `admin` or `restricted`. When set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. | +**Scopes** | **[]string** | Add or remove permissions that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this property in the request when the `permission_type` property is set to `admin`—administrators have full access to the specified Subuser. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoTeammatesBaseResponseProps.md b/rest/api/v3/sso/docs/SsoTeammatesBaseResponseProps.md new file mode 100644 index 00000000..a2de9c35 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesBaseResponseProps.md @@ -0,0 +1,16 @@ +# SsoTeammatesBaseResponseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | The Teammate's first name. |[optional] +**LastName** | **string** | The Teammate's last name. |[optional] +**Email** | **string** | Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. |[optional] +**IsAdmin** | **bool** | Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. |[optional] +**IsSso** | **bool** | Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. |[optional] +**Scopes** | **[]string** | The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponseProps.md b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponseProps.md new file mode 100644 index 00000000..a22ffc8f --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponseProps.md @@ -0,0 +1,12 @@ +# SsoTeammatesRestrictedSubuserResponseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasRestrictedSubuserAccess** | **bool** | When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. |[optional] +**SubuserAccess** | [**[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner**](SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md) | Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md new file mode 100644 index 00000000..c7c93940 --- /dev/null +++ b/rest/api/v3/sso/docs/SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner.md @@ -0,0 +1,16 @@ +# SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of a Subuser to which the Teammate has access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). |[optional] +**Username** | **string** | The username of a Subuser to which the Teammate has access. |[optional] +**Email** | **string** | The email address of a Subuser to which the Teammate has access. |[optional] +**Disabled** | **bool** | Indicates if the Subuser is active for the SendGrid account. |[optional] +**PermissionType** | [**PermissionType1**](PermissionType1.md) | The level of access the Teammate has to the specified Subuser. This property value may be either `admin` or `restricted`. When is property is set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. |[optional] +**Scopes** | **[]string** | The permissions or scopes that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/UpdateSsoCertificate.md b/rest/api/v3/sso/docs/UpdateSsoCertificate.md new file mode 100644 index 00000000..0873a139 --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoCertificate.md @@ -0,0 +1,52 @@ +# UpdateSsoCertificate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSsoCertificate**](UpdateSsoCertificate.md#UpdateSsoCertificate) | **Patch** /v3/sso/certificates/{CertId} | Update SSO Certificate + + + +## UpdateSsoCertificate + +> SsoCertificateBody UpdateSsoCertificate(ctx, CertIdoptional) + +Update SSO Certificate + +**This endpoint allows you to update an existing certificate by ID.** You can retrieve a certificate's ID from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**CertId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSsoCertificateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateSsoCertificateRequest** | [**UpdateSsoCertificateRequest**](UpdateSsoCertificateRequest.md) | + +### Return type + +[**SsoCertificateBody**](SsoCertificateBody.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/UpdateSsoCertificateRequest.md b/rest/api/v3/sso/docs/UpdateSsoCertificateRequest.md new file mode 100644 index 00000000..6155b47c --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoCertificateRequest.md @@ -0,0 +1,13 @@ +# UpdateSsoCertificateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PublicCertificate** | **string** | This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. |[optional] +**Enabled** | **bool** | Indicates whether or not the certificate is enabled. |[optional] +**IntegrationId** | **string** | An ID that matches a certificate to a specific IdP integration. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/docs/UpdateSsoIntegration.md b/rest/api/v3/sso/docs/UpdateSsoIntegration.md new file mode 100644 index 00000000..c6e31fe7 --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoIntegration.md @@ -0,0 +1,53 @@ +# UpdateSsoIntegration + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSsoIntegration**](UpdateSsoIntegration.md#UpdateSsoIntegration) | **Patch** /v3/sso/integrations/{Id} | Update an SSO Integration + + + +## UpdateSsoIntegration + +> SsoIntegration UpdateSsoIntegration(ctx, Idoptional) + +Update an SSO Integration + +**This endpoint allows you to modify an exisiting SSO integration.** You can retrieve the IDs for your configurations from the response provided by the \"Get All SSO Integrations\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSsoIntegrationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Si** | **bool** | If this parameter is set to `true`, the response will include the `completed_integration` field. +**PostPatchIntegrationRequest** | [**PostPatchIntegrationRequest**](PostPatchIntegrationRequest.md) | + +### Return type + +[**SsoIntegration**](SsoIntegration.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/UpdateSsoTeammate.md b/rest/api/v3/sso/docs/UpdateSsoTeammate.md new file mode 100644 index 00000000..cc802214 --- /dev/null +++ b/rest/api/v3/sso/docs/UpdateSsoTeammate.md @@ -0,0 +1,52 @@ +# UpdateSsoTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSsoTeammate**](UpdateSsoTeammate.md#UpdateSsoTeammate) | **Patch** /v3/sso/teammates/{Username} | Edit an SSO Teammate + + + +## UpdateSsoTeammate + +> PatchSsoTeammates200 UpdateSsoTeammate(ctx, Usernameoptional) + +Edit an SSO Teammate + +**This endpoint allows you to modify an existing SSO Teammate.** Only the parent user and Teammates with admin permissions can update another Teammate's permissions. ### Scopes When updating a Teammate, you will assign it permissions or scopes. These scopes determine which actions the Teammate can perform and which features they can access. Scopes are provided with one of three properties passed to this endpoint: `is_admin`, `scopes`, and `persona`. You can make a Teammate an administrator by setting `is_admin` to `true`. Administrators will have all scopes assigned to them. Alternatively, you can assign a `persona` to the teammate, which will assign them a block of permissions commonly required for that type of user. See the \"Persona scopes\" section of [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions#persona-scopes) for a list of permsissions granted by persona. Lastly, you can assign individual permissions with the `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of scopes that can be assigned to a Teammate. ### Subuser access SendGrid Teammates may be assigned access to one or more Subusers. Subusers function like SendGrid sub-accounts with their own resources. See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. When assigning Subuser access to a Teammate, you may set the `has_restricted_subuser_access` property to `true` to constrain the Teammate so that they can operate only on behalf of the Subusers to which they are assigned. You may further set the level of access the Teammate has to each Subuser with the `subuser_access` property. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Username** | **string** | Set this parameter to the Teammate's email address. This address must be the same address assigned to the Teammate in your IdP. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSsoTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Body** | **SsoTeammatesBaseRequestProps** | + +### Return type + +[**PatchSsoTeammates200**](PatchSsoTeammates200.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/sso/docs/UserType.md b/rest/api/v3/sso/docs/UserType.md new file mode 100644 index 00000000..f9f8db1d --- /dev/null +++ b/rest/api/v3/sso/docs/UserType.md @@ -0,0 +1,14 @@ +# UserType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**OWNER** | string | (value: `"owner"`) +**TEAMMATE** | string | (value: `"teammate"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/sso/model_create_sso_certificate_request.go b/rest/api/v3/sso/model_create_sso_certificate_request.go new file mode 100644 index 00000000..da1fc7ba --- /dev/null +++ b/rest/api/v3/sso/model_create_sso_certificate_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSsoCertificateRequest +type CreateSsoCertificateRequest struct { + // This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. + PublicCertificate string `json:"public_certificate"` + // Indicates if the certificate is enabled. + Enabled *bool `json:"enabled,omitempty"` + // An ID that matches a certificate to a specific IdP integration. This is the `id` returned by the \"Get All SSO Integrations\" endpoint. + IntegrationId string `json:"integration_id"` +} diff --git a/rest/api/v3/sso/model_patch_sso_teammates200.go b/rest/api/v3/sso/model_patch_sso_teammates200.go new file mode 100644 index 00000000..0031305b --- /dev/null +++ b/rest/api/v3/sso/model_patch_sso_teammates200.go @@ -0,0 +1,56 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PatchSsoTeammates200 Successful SSO Teammates PATCH response. +type PatchSsoTeammates200 struct { + // The Teammate's street address. + Address *string `json:"address,omitempty"` + // The Teammate's apartment number, suite number, or other secondary address information that is not part of the physical street address. + Address2 *string `json:"address2,omitempty"` + // The Teammate's city. + City *string `json:"city,omitempty"` + // The Teammate's company name. + Company *string `json:"company,omitempty"` + // The Teammate's country of residence. + Country *string `json:"country,omitempty"` + // The Teammate's username. This property is set to the Teammate's email address. + Username *string `json:"username,omitempty"` + // The Teammate's phone number. + Phone *string `json:"phone,omitempty"` + // The Teammate's state or province. + State *string `json:"state,omitempty"` + // A Teammate can be an `admin`, `owner`, or `teammate`. Each role is associated with the scope of the Teammate's permissions. + UserType *UserType `json:"user_type,omitempty"` + // A website associated with the Teammate. + Website *string `json:"website,omitempty"` + // The Teammate's zip code. + Zip *string `json:"zip,omitempty"` + // The Teammate's first name. + FirstName *string `json:"first_name,omitempty"` + // The Teammate's last name. + LastName *string `json:"last_name,omitempty"` + // Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email *string `json:"email,omitempty"` + // Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. + IsAdmin *bool `json:"is_admin,omitempty"` + // Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. + IsSso *bool `json:"is_sso,omitempty"` + // The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` + // When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. + SubuserAccess *[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_permission_type.go b/rest/api/v3/sso/model_permission_type.go new file mode 100644 index 00000000..c496f95f --- /dev/null +++ b/rest/api/v3/sso/model_permission_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PermissionType the model 'PermissionType' +type PermissionType string + +// List of PermissionType +const ( + PERMISSIONTYPE_ADMIN PermissionType = "admin" + PERMISSIONTYPE_RESTRICTED PermissionType = "restricted" +) diff --git a/rest/api/v3/sso/model_permission_type1.go b/rest/api/v3/sso/model_permission_type1.go new file mode 100644 index 00000000..03271a27 --- /dev/null +++ b/rest/api/v3/sso/model_permission_type1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PermissionType1 the model 'PermissionType1' +type PermissionType1 string + +// List of PermissionType1 +const ( + PERMISSIONTYPE1_ADMIN PermissionType1 = "admin" + PERMISSIONTYPE1_RESTRICTED PermissionType1 = "restricted" +) diff --git a/rest/api/v3/sso/model_persona.go b/rest/api/v3/sso/model_persona.go new file mode 100644 index 00000000..bbd9d832 --- /dev/null +++ b/rest/api/v3/sso/model_persona.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Persona the model 'Persona' +type Persona string + +// List of Persona +const ( + PERSONA_ACCOUNTANT Persona = "accountant" + PERSONA_DEVELOPER Persona = "developer" + PERSONA_MARKETER Persona = "marketer" + PERSONA_OBSERVER Persona = "observer" +) diff --git a/rest/api/v3/sso/model_post_patch_integration_request.go b/rest/api/v3/sso/model_post_patch_integration_request.go new file mode 100644 index 00000000..6cdedd95 --- /dev/null +++ b/rest/api/v3/sso/model_post_patch_integration_request.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PostPatchIntegrationRequest struct for PostPatchIntegrationRequest +type PostPatchIntegrationRequest struct { + // The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) + Name string `json:"name"` + // Indicates if the integration is enabled. + Enabled bool `json:"enabled"` + // The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. + SigninUrl string `json:"signin_url"` + // This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. + SignoutUrl string `json:"signout_url"` + // An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. + EntityId string `json:"entity_id"` + // Indicates if the integration is complete. + CompletedIntegration *bool `json:"completed_integration,omitempty"` +} diff --git a/rest/api/v3/sso/model_post_sso_teammates201.go b/rest/api/v3/sso/model_post_sso_teammates201.go new file mode 100644 index 00000000..5863ff95 --- /dev/null +++ b/rest/api/v3/sso/model_post_sso_teammates201.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PostSsoTeammates201 Successful SSO Teammates POST Response. +type PostSsoTeammates201 struct { + // The Teammate's first name. + FirstName *string `json:"first_name,omitempty"` + // The Teammate's last name. + LastName *string `json:"last_name,omitempty"` + // Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email *string `json:"email,omitempty"` + // Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. + IsAdmin *bool `json:"is_admin,omitempty"` + // Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. + IsSso *bool `json:"is_sso,omitempty"` + // The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` + // When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. + SubuserAccess *[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_post_sso_teammates_request.go b/rest/api/v3/sso/model_post_sso_teammates_request.go new file mode 100644 index 00000000..5f4e5543 --- /dev/null +++ b/rest/api/v3/sso/model_post_sso_teammates_request.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PostSsoTeammatesRequest struct for PostSsoTeammatesRequest +type PostSsoTeammatesRequest struct { + // Set this property to the Teammate's email address. This email address will also function as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email string `json:"email"` + // Set this property to the Teammate's first name. + FirstName string `json:"first_name"` + // Set this property to the Teammate's last name. + LastName string `json:"last_name"` + // Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. + IsAdmin *bool `json:"is_admin,omitempty"` + // A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. + Persona *Persona `json:"persona,omitempty"` + // Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. + Scopes *[]string `json:"scopes,omitempty"` + // Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. + SubuserAccess *[]SsoTeammatesBaseRequestPropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_certificate_body.go b/rest/api/v3/sso/model_sso_certificate_body.go new file mode 100644 index 00000000..1a001b81 --- /dev/null +++ b/rest/api/v3/sso/model_sso_certificate_body.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoCertificateBody struct for SsoCertificateBody +type SsoCertificateBody struct { + // This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta. This is called the X509 certificate in the Twilio SendGrid UI. + PublicCertificate *string `json:"public_certificate,omitempty"` + // A unique ID assigned to the certificate by SendGrid. + Id *float32 `json:"id,omitempty"` + // A unix timestamp (e.g., 1603915954) that indicates the time before which the certificate is not valid. + NotBefore *float32 `json:"not_before,omitempty"` + // A unix timestamp (e.g., 1603915954) that indicates the time after which the certificate is no longer valid. + NotAfter *float32 `json:"not_after,omitempty"` + // An ID that matches a certificate to a specific IdP integration. + IntergrationId *string `json:"intergration_id,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_error_response_inner.go b/rest/api/v3/sso/model_sso_error_response_inner.go new file mode 100644 index 00000000..17711b3d --- /dev/null +++ b/rest/api/v3/sso/model_sso_error_response_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoErrorResponseInner struct for SsoErrorResponseInner +type SsoErrorResponseInner struct { + Message *string `json:"message,omitempty"` + Field *string `json:"field,omitempty"` + ErrorId *string `json:"error_id,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_integration.go b/rest/api/v3/sso/model_sso_integration.go new file mode 100644 index 00000000..888e08da --- /dev/null +++ b/rest/api/v3/sso/model_sso_integration.go @@ -0,0 +1,38 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoIntegration struct for SsoIntegration +type SsoIntegration struct { + // The name of your integration. This name can be anything that makes sense for your organization (eg. Twilio SendGrid) + Name string `json:"name"` + // Indicates if the integration is enabled. + Enabled bool `json:"enabled"` + // The IdP's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. This is called the \"Embed Link\" in the Twilio SendGrid UI. + SigninUrl string `json:"signin_url"` + // This URL is relevant only for an IdP-initiated authentication flow. If a user authenticates from their IdP, this URL will return them to their IdP when logging out. + SignoutUrl string `json:"signout_url"` + // An identifier provided by your IdP to identify Twilio SendGrid in the SAML interaction. This is called the \"SAML Issuer ID\" in the Twilio SendGrid UI. + EntityId string `json:"entity_id"` + // Indicates if the integration is complete. + CompletedIntegration *bool `json:"completed_integration,omitempty"` + // A timestamp representing the last time the configuration was modified. + LastUpdated float32 `json:"last_updated"` + // A unique ID assigned to the configuration by SendGrid. + Id *string `json:"id,omitempty"` + // The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using SendGrid. + SingleSignonUrl *string `json:"single_signon_url,omitempty"` + // The URL where your IdP should POST its SAML response. This is the Twilio SendGrid URL that is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using SendGrid. + AudienceUrl *string `json:"audience_url,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_base_request_props.go b/rest/api/v3/sso/model_sso_teammates_base_request_props.go new file mode 100644 index 00000000..8fd3ef6d --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_base_request_props.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesBaseRequestProps struct for SsoTeammatesBaseRequestProps +type SsoTeammatesBaseRequestProps struct { + // Set this property to the Teammate's first name. + FirstName string `json:"first_name"` + // Set this property to the Teammate's last name. + LastName string `json:"last_name"` + // Set this property to `true` if the Teammate has admin permissions. You should not include the `scopes` or `persona` properties when setting the `is_admin` property to `true`—an admin will be allocated all scopes. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of scopes. + IsAdmin *bool `json:"is_admin,omitempty"` + // A persona represents a group of permissions often required by a type of Teammate such as a developer or marketer. Assigning a persona allows you to allocate a group of pre-defined permissions rather than assigning each scope individually. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a full list of the scopes assigned to each persona. + Persona *Persona `json:"persona,omitempty"` + // Add or remove permissions from a Teammate using this `scopes` property. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this propety in the request when using the `persona` property or when setting the `is_admin` property to `true`—assigning a `persona` or setting `is_admin` to `true` will allocate a group of permissions to the Teammate. + Scopes *[]string `json:"scopes,omitempty"` + // Set this property to `true` to give the Teammate permissions to operate only on behalf of a Subuser. This property value must be `true` if the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. If this property is set to `true`, you cannot specify individual `scopes`, assign a `persona`, or set `is_admin` to `true`—a Teammate cannot specify scopes for the parent account and have restricted Subuser access. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specify which Subusers the Teammate may access and act on behalf of with this property. If this property is populated, you must set the `has_restricted_subuser_access` property to `true`. + SubuserAccess *[]SsoTeammatesBaseRequestPropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_base_request_props_subuser_access_inner.go b/rest/api/v3/sso/model_sso_teammates_base_request_props_subuser_access_inner.go new file mode 100644 index 00000000..6a9499bd --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_base_request_props_subuser_access_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesBaseRequestPropsSubuserAccessInner An array of Subusers to which the Teammate should have access. +type SsoTeammatesBaseRequestPropsSubuserAccessInner struct { + // Set this property to the ID of a Subuser to which the Teammate should have access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). + Id int32 `json:"id"` + // Grant the level of access the Teammate should have to the specified Subuser with this property. This property value may be either `admin` or `restricted`. When set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. + PermissionType PermissionType `json:"permission_type"` + // Add or remove permissions that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. You should not include this property in the request when the `permission_type` property is set to `admin`—administrators have full access to the specified Subuser. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_base_response_props.go b/rest/api/v3/sso/model_sso_teammates_base_response_props.go new file mode 100644 index 00000000..ca10b302 --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_base_response_props.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesBaseResponseProps struct for SsoTeammatesBaseResponseProps +type SsoTeammatesBaseResponseProps struct { + // The Teammate's first name. + FirstName *string `json:"first_name,omitempty"` + // The Teammate's last name. + LastName *string `json:"last_name,omitempty"` + // Teammate's email address. This email address also functions as the Teammate's username and must match the address assigned to the user in your IdP. This address cannot be changed after the Teammate is created. + Email *string `json:"email,omitempty"` + // Indicates if the Teammate has administrator permissions. When set to `true`, the Teammate is an admin. + IsAdmin *bool `json:"is_admin,omitempty"` + // Indicates how the Teammate authenticates with SendGrid. When set to `true`, the Teammate will access SendGrid via SSO and their IdP. When set to `false`, the Teammate will authenticate directly with SendGrid via a username and password. + IsSso *bool `json:"is_sso,omitempty"` + // The permissions or scopes currently assigned to the Teammate. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props.go b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props.go new file mode 100644 index 00000000..4570072d --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesRestrictedSubuserResponseProps struct for SsoTeammatesRestrictedSubuserResponseProps +type SsoTeammatesRestrictedSubuserResponseProps struct { + // When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. + SubuserAccess *[]SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner `json:"subuser_access,omitempty"` +} diff --git a/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go new file mode 100644 index 00000000..9d151365 --- /dev/null +++ b/rest/api/v3/sso/model_sso_teammates_restricted_subuser_response_props_subuser_access_inner.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner An array of Subusers to which the Teammate has access. +type SsoTeammatesRestrictedSubuserResponsePropsSubuserAccessInner struct { + // The ID of a Subuser to which the Teammate has access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). + Id *int32 `json:"id,omitempty"` + // The username of a Subuser to which the Teammate has access. + Username *string `json:"username,omitempty"` + // The email address of a Subuser to which the Teammate has access. + Email *string `json:"email,omitempty"` + // Indicates if the Subuser is active for the SendGrid account. + Disabled *bool `json:"disabled,omitempty"` + // The level of access the Teammate has to the specified Subuser. This property value may be either `admin` or `restricted`. When is property is set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. + PermissionType *PermissionType1 `json:"permission_type,omitempty"` + // The permissions or scopes that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/sso/model_update_sso_certificate_request.go b/rest/api/v3/sso/model_update_sso_certificate_request.go new file mode 100644 index 00000000..fd83330d --- /dev/null +++ b/rest/api/v3/sso/model_update_sso_certificate_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSsoCertificateRequest struct for UpdateSsoCertificateRequest +type UpdateSsoCertificateRequest struct { + // This public certificate allows SendGrid to verify that SAML requests it receives are signed by an IdP that it recognizes. + PublicCertificate *string `json:"public_certificate,omitempty"` + // Indicates whether or not the certificate is enabled. + Enabled *bool `json:"enabled,omitempty"` + // An ID that matches a certificate to a specific IdP integration. + IntegrationId *string `json:"integration_id,omitempty"` +} diff --git a/rest/api/v3/sso/model_user_type.go b/rest/api/v3/sso/model_user_type.go new file mode 100644 index 00000000..3042c84a --- /dev/null +++ b/rest/api/v3/sso/model_user_type.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Single Sign-On API +* The Single Sign-On API allows you to manage your SAML 2.0 SSO configurations. You can also work with your SSO integrations using the SSO section of the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/sso). The Single Sign-On Settings operations allow you to create, retrieve, modify, and delete SSO integrations for your Twilio SendGrid account. Each integration will correspond to a specific IdP such as Okta, Duo, or Microsoft Azure Active Directory. The Single Sign-On Certificates operations allow you to create, modify, and delete SSO certificates. A SAML certificate allows your IdP and Twilio SendGrid to verify requests are coming from one another using the `public_certificate` and `integration_id` parameters. The Single Sign-On Teammates operations allow you to add and modify SSO Teammates. SSO Teammates are the individual user accounts who will access your Twilio SendGrid account with SSO credentials. To retrieve or delete an SSO Teammate, you will use the separate [Teammates API](https://docs.sendgrid.com/api-reference/teammates/). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UserType the model 'UserType' +type UserType string + +// List of UserType +const ( + USERTYPE_ADMIN UserType = "admin" + USERTYPE_OWNER UserType = "owner" + USERTYPE_TEAMMATE UserType = "teammate" +) diff --git a/rest/api/v3/stats/README.md b/rest/api/v3/stats/README.md new file mode 100644 index 00000000..cbe90f58 --- /dev/null +++ b/rest/api/v3/stats/README.md @@ -0,0 +1,104 @@ +# Go API client for + +The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. + +Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. + +SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. + +Category statistics are available for the previous thirteen months only. + +See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.483887+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*GetClientStat* | [**GetClientStat**](docs/GetClientStat.md#getclientstat) | **Get** /v3/clients/{ClientType}/stats | Retrieve stats by a specific client type. +*ListBrowserStat* | [**ListBrowserStat**](docs/ListBrowserStat.md#listbrowserstat) | **Get** /v3/browsers/stats | Retrieve email statistics by browser. +*ListCategory* | [**ListCategory**](docs/ListCategory.md#listcategory) | **Get** /v3/categories | Retrieve all categories +*ListCategoryStat* | [**ListCategoryStat**](docs/ListCategoryStat.md#listcategorystat) | **Get** /v3/categories/stats | Retrieve Email Statistics for Categories +*ListCategoryStatSum* | [**ListCategoryStatSum**](docs/ListCategoryStatSum.md#listcategorystatsum) | **Get** /v3/categories/stats/sums | Retrieve sums of email stats for each category. +*ListClientStat* | [**ListClientStat**](docs/ListClientStat.md#listclientstat) | **Get** /v3/clients/stats | Retrieve email statistics by client type. +*ListDeviceStat* | [**ListDeviceStat**](docs/ListDeviceStat.md#listdevicestat) | **Get** /v3/devices/stats | Retrieve email statistics by device type. +*ListGeoStat* | [**ListGeoStat**](docs/ListGeoStat.md#listgeostat) | **Get** /v3/geo/stats | Retrieve email statistics by country and state/province. +*ListMailboxProviderStat* | [**ListMailboxProviderStat**](docs/ListMailboxProviderStat.md#listmailboxproviderstat) | **Get** /v3/mailbox_providers/stats | Retrieve email statistics by mailbox provider. +*ListStat* | [**ListStat**](docs/ListStat.md#liststat) | **Get** /v3/stats | Retrieve global email statistics + + +## Documentation For Models + + - [AdvancedStatsClicks](AdvancedStatsClicks.md) + - [AdvancedStatsClicksOpens](AdvancedStatsClicksOpens.md) + - [AdvancedStatsMailboxProvider](AdvancedStatsMailboxProvider.md) + - [AdvancedStatsOpens](AdvancedStatsOpens.md) + - [AggregatedBy](AggregatedBy.md) + - [AggregatedBy1](AggregatedBy1.md) + - [AggregatedBy2](AggregatedBy2.md) + - [AggregatedBy3](AggregatedBy3.md) + - [CategoryStats](CategoryStats.md) + - [CategoryStatsStatsInner](CategoryStatsStatsInner.md) + - [CategoryStatsStatsInnerMetrics](CategoryStatsStatsInnerMetrics.md) + - [ClientType](ClientType.md) + - [Country](Country.md) + - [ListBrowserStat200ResponseInner](ListBrowserStat200ResponseInner.md) + - [ListBrowserStat200ResponseInnerStatsInner](ListBrowserStat200ResponseInnerStatsInner.md) + - [ListCategory200ResponseInner](ListCategory200ResponseInner.md) + - [ListCategory400Response](ListCategory400Response.md) + - [ListCategory400ResponseErrorsInner](ListCategory400ResponseErrorsInner.md) + - [ListClientStat200ResponseInner](ListClientStat200ResponseInner.md) + - [ListClientStat200ResponseInnerStatsInner](ListClientStat200ResponseInnerStatsInner.md) + - [ListGeoStat200ResponseInner](ListGeoStat200ResponseInner.md) + - [ListGeoStat200ResponseInnerStatsInner](ListGeoStat200ResponseInnerStatsInner.md) + - [ListMailboxProviderStat200ResponseInner](ListMailboxProviderStat200ResponseInner.md) + - [ListMailboxProviderStat200ResponseInnerStatsInner](ListMailboxProviderStat200ResponseInnerStatsInner.md) + - [ListStat200ResponseInner](ListStat200ResponseInner.md) + - [ListStat200ResponseInnerStatsInner](ListStat200ResponseInnerStatsInner.md) + - [SortByDirection](SortByDirection.md) + - [StatsAdvancedGlobalStats](StatsAdvancedGlobalStats.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/stats/api_get_client_stat.go b/rest/api/v3/stats/api_get_client_stat.go new file mode 100644 index 00000000..79d26053 --- /dev/null +++ b/rest/api/v3/stats/api_get_client_stat.go @@ -0,0 +1,99 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type GetClientStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // Specifies the type of client to retrieve stats for. Must be either \"phone\", \"tablet\", \"webmail\", or \"desktop\". + ClientType *ClientType `json:"client_type"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy2 `json:"aggregated_by,omitempty"` +} + +func (params *GetClientStatParam) SetStartDate(StartDate string) *GetClientStatParam { + params.StartDate = &StartDate + return params +} +func (params *GetClientStatParam) SetClientType(ClientType ClientType) *GetClientStatParam { + params.ClientType = &ClientType + return params +} +func (params *GetClientStatParam) SetOnbehalfof(Onbehalfof string) *GetClientStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *GetClientStatParam) SetEndDate(EndDate string) *GetClientStatParam { + params.EndDate = &EndDate + return params +} +func (params *GetClientStatParam) SetAggregatedBy(AggregatedBy AggregatedBy2) *GetClientStatParam { + params.AggregatedBy = &AggregatedBy + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by a specific client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ### Available Client Types - phone - tablet - webmail - desktop Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) GetClientStat(params *GetClientStatParam) (interface{}, error) { + path := "/v3/clients/{ClientType}/stats" + if params != nil && params.ClientType != nil { + path = strings.Replace(path, "{"+"ClientType"+"}", fmt.Sprint(*params.ClientType), -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListClientStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_browser_stat.go b/rest/api/v3/stats/api_list_browser_stat.go new file mode 100644 index 00000000..ba98d00b --- /dev/null +++ b/rest/api/v3/stats/api_list_browser_stat.go @@ -0,0 +1,115 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListBrowserStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The browsers to get statistics for. You can include up to 10 different browsers by including this parameter multiple times. + Browsers *string `json:"browsers,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListBrowserStatParam) SetStartDate(StartDate string) *ListBrowserStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListBrowserStatParam) SetBrowsers(Browsers string) *ListBrowserStatParam { + params.Browsers = &Browsers + return params +} +func (params *ListBrowserStatParam) SetOnbehalfof(Onbehalfof string) *ListBrowserStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListBrowserStatParam) SetLimit(Limit int32) *ListBrowserStatParam { + params.Limit = &Limit + return params +} +func (params *ListBrowserStatParam) SetOffset(Offset int32) *ListBrowserStatParam { + params.Offset = &Offset + return params +} +func (params *ListBrowserStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListBrowserStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListBrowserStatParam) SetEndDate(EndDate string) *ListBrowserStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by browser type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListBrowserStat(params *ListBrowserStatParam) (interface{}, error) { + path := "/v3/browsers/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Browsers != nil { + data.Set("browsers", *params.Browsers) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListBrowserStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_category.go b/rest/api/v3/stats/api_list_category.go new file mode 100644 index 00000000..7e8feae7 --- /dev/null +++ b/rest/api/v3/stats/api_list_category.go @@ -0,0 +1,96 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListCategoryParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // Allows you to perform a prefix search on this particular category. + Category *string `json:"category,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCategoryParam) SetLimit(Limit int32) *ListCategoryParam { + params.Limit = &Limit + return params +} +func (params *ListCategoryParam) SetCategory(Category string) *ListCategoryParam { + params.Category = &Category + return params +} +func (params *ListCategoryParam) SetOffset(Offset int32) *ListCategoryParam { + params.Offset = &Offset + return params +} +func (params *ListCategoryParam) SetOnbehalfof(Onbehalfof string) *ListCategoryParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all of your categories.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListCategory(params *ListCategoryParam) (interface{}, error) { + path := "/v3/categories" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Category != nil { + data.Set("category", *params.Category) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListCategory200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListCategory400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_category_stat.go b/rest/api/v3/stats/api_list_category_stat.go new file mode 100644 index 00000000..c3fdfd6d --- /dev/null +++ b/rest/api/v3/stats/api_list_category_stat.go @@ -0,0 +1,97 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListCategoryStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD + StartDate *string `json:"start_date"` + // The individual categories that you want to retrieve statistics for. You may include up to 10 different categories. + Categories *string `json:"categories"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy `json:"aggregated_by,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCategoryStatParam) SetStartDate(StartDate string) *ListCategoryStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListCategoryStatParam) SetCategories(Categories string) *ListCategoryStatParam { + params.Categories = &Categories + return params +} +func (params *ListCategoryStatParam) SetEndDate(EndDate string) *ListCategoryStatParam { + params.EndDate = &EndDate + return params +} +func (params *ListCategoryStatParam) SetAggregatedBy(AggregatedBy AggregatedBy) *ListCategoryStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListCategoryStatParam) SetOnbehalfof(Onbehalfof string) *ListCategoryStatParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of your email statistics for each of your categories.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. +func (c *ApiService) ListCategoryStat(params *ListCategoryStatParam) (interface{}, error) { + path := "/v3/categories/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Categories != nil { + data.Set("categories", *params.Categories) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]CategoryStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_category_stat_sum.go b/rest/api/v3/stats/api_list_category_stat_sum.go new file mode 100644 index 00000000..4e438e67 --- /dev/null +++ b/rest/api/v3/stats/api_list_category_stat_sum.go @@ -0,0 +1,124 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListCategoryStatSumParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The metric that you want to sort by. Must be a single metric. + SortByMetric *string `json:"sort_by_metric,omitempty"` + // The direction you want to sort. + SortByDirection *SortByDirection `json:"sort_by_direction,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // Limits the number of results returned. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy1 `json:"aggregated_by,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCategoryStatSumParam) SetStartDate(StartDate string) *ListCategoryStatSumParam { + params.StartDate = &StartDate + return params +} +func (params *ListCategoryStatSumParam) SetSortByMetric(SortByMetric string) *ListCategoryStatSumParam { + params.SortByMetric = &SortByMetric + return params +} +func (params *ListCategoryStatSumParam) SetSortByDirection(SortByDirection SortByDirection) *ListCategoryStatSumParam { + params.SortByDirection = &SortByDirection + return params +} +func (params *ListCategoryStatSumParam) SetEndDate(EndDate string) *ListCategoryStatSumParam { + params.EndDate = &EndDate + return params +} +func (params *ListCategoryStatSumParam) SetLimit(Limit int32) *ListCategoryStatSumParam { + params.Limit = &Limit + return params +} +func (params *ListCategoryStatSumParam) SetOffset(Offset int32) *ListCategoryStatSumParam { + params.Offset = &Offset + return params +} +func (params *ListCategoryStatSumParam) SetAggregatedBy(AggregatedBy AggregatedBy1) *ListCategoryStatSumParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListCategoryStatSumParam) SetOnbehalfof(Onbehalfof string) *ListCategoryStatSumParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. +func (c *ApiService) ListCategoryStatSum(params *ListCategoryStatSumParam) (interface{}, error) { + path := "/v3/categories/stats/sums" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.SortByMetric != nil { + data.Set("sort_by_metric", *params.SortByMetric) + } + if params != nil && params.SortByDirection != nil { + data.Set("sort_by_direction", fmt.Sprint(*params.SortByDirection)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &CategoryStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_client_stat.go b/rest/api/v3/stats/api_list_client_stat.go new file mode 100644 index 00000000..baa57667 --- /dev/null +++ b/rest/api/v3/stats/api_list_client_stat.go @@ -0,0 +1,88 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListClientStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy2 `json:"aggregated_by,omitempty"` +} + +func (params *ListClientStatParam) SetStartDate(StartDate string) *ListClientStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListClientStatParam) SetOnbehalfof(Onbehalfof string) *ListClientStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListClientStatParam) SetEndDate(EndDate string) *ListClientStatParam { + params.EndDate = &EndDate + return params +} +func (params *ListClientStatParam) SetAggregatedBy(AggregatedBy AggregatedBy2) *ListClientStatParam { + params.AggregatedBy = &AggregatedBy + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListClientStat(params *ListClientStatParam) (interface{}, error) { + path := "/v3/clients/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListClientStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_device_stat.go b/rest/api/v3/stats/api_list_device_stat.go new file mode 100644 index 00000000..0f099f97 --- /dev/null +++ b/rest/api/v3/stats/api_list_device_stat.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListDeviceStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListDeviceStatParam) SetStartDate(StartDate string) *ListDeviceStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListDeviceStatParam) SetOnbehalfof(Onbehalfof string) *ListDeviceStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListDeviceStatParam) SetLimit(Limit int32) *ListDeviceStatParam { + params.Limit = &Limit + return params +} +func (params *ListDeviceStatParam) SetOffset(Offset int32) *ListDeviceStatParam { + params.Offset = &Offset + return params +} +func (params *ListDeviceStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListDeviceStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListDeviceStatParam) SetEndDate(EndDate string) *ListDeviceStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by the device type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Device Types | **Device** | **Description** | **Example** | |---|---|---| | Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | | Phone | A smart phone. | iPhone, Android, Blackberry, etc. | Tablet | A tablet computer. | iPad, android based tablet, etc. | | Other | An unrecognized device. | Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListDeviceStat(params *ListDeviceStatParam) (interface{}, error) { + path := "/v3/devices/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListClientStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_geo_stat.go b/rest/api/v3/stats/api_list_geo_stat.go new file mode 100644 index 00000000..fda486f1 --- /dev/null +++ b/rest/api/v3/stats/api_list_geo_stat.go @@ -0,0 +1,115 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListGeoStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The country you would like to see statistics for. Currently only supported for US and CA. + Country *Country `json:"country,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListGeoStatParam) SetStartDate(StartDate string) *ListGeoStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListGeoStatParam) SetCountry(Country Country) *ListGeoStatParam { + params.Country = &Country + return params +} +func (params *ListGeoStatParam) SetOnbehalfof(Onbehalfof string) *ListGeoStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListGeoStatParam) SetLimit(Limit int32) *ListGeoStatParam { + params.Limit = &Limit + return params +} +func (params *ListGeoStatParam) SetOffset(Offset int32) *ListGeoStatParam { + params.Offset = &Offset + return params +} +func (params *ListGeoStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListGeoStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListGeoStatParam) SetEndDate(EndDate string) *ListGeoStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by country and state/province.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://wwww.twilio.com/docs/sendgrid/ui/analytics-and-reporting/stats-overview). +func (c *ApiService) ListGeoStat(params *ListGeoStatParam) (interface{}, error) { + path := "/v3/geo/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Country != nil { + data.Set("country", fmt.Sprint(*params.Country)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListGeoStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_mailbox_provider_stat.go b/rest/api/v3/stats/api_list_mailbox_provider_stat.go new file mode 100644 index 00000000..b9e15837 --- /dev/null +++ b/rest/api/v3/stats/api_list_mailbox_provider_stat.go @@ -0,0 +1,115 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListMailboxProviderStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The mail box providers to get statistics for. You can include up to 10 by including this parameter multiple times. + MailboxProviders *string `json:"mailbox_providers,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListMailboxProviderStatParam) SetStartDate(StartDate string) *ListMailboxProviderStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListMailboxProviderStatParam) SetMailboxProviders(MailboxProviders string) *ListMailboxProviderStatParam { + params.MailboxProviders = &MailboxProviders + return params +} +func (params *ListMailboxProviderStatParam) SetOnbehalfof(Onbehalfof string) *ListMailboxProviderStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListMailboxProviderStatParam) SetLimit(Limit int32) *ListMailboxProviderStatParam { + params.Limit = &Limit + return params +} +func (params *ListMailboxProviderStatParam) SetOffset(Offset int32) *ListMailboxProviderStatParam { + params.Offset = &Offset + return params +} +func (params *ListMailboxProviderStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListMailboxProviderStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListMailboxProviderStatParam) SetEndDate(EndDate string) *ListMailboxProviderStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve your email statistics segmented by recipient mailbox provider.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). +func (c *ApiService) ListMailboxProviderStat(params *ListMailboxProviderStatParam) (interface{}, error) { + path := "/v3/mailbox_providers/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.MailboxProviders != nil { + data.Set("mailbox_providers", *params.MailboxProviders) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListMailboxProviderStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_list_stat.go b/rest/api/v3/stats/api_list_stat.go new file mode 100644 index 00000000..ee9c2531 --- /dev/null +++ b/rest/api/v3/stats/api_list_stat.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListStatParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // The number of results to return. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy3 `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListStatParam) SetStartDate(StartDate string) *ListStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListStatParam) SetOnbehalfof(Onbehalfof string) *ListStatParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListStatParam) SetLimit(Limit int32) *ListStatParam { + params.Limit = &Limit + return params +} +func (params *ListStatParam) SetOffset(Offset int32) *ListStatParam { + params.Offset = &Offset + return params +} +func (params *ListStatParam) SetAggregatedBy(AggregatedBy AggregatedBy3) *ListStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListStatParam) SetEndDate(EndDate string) *ListStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve all of your global email statistics between a given date range.** Parent accounts can see either aggregated stats for the parent account or aggregated stats for a subuser specified in the `on-behalf-of` header. Subuser accounts will see only their own stats. +func (c *ApiService) ListStat(params *ListStatParam) (interface{}, error) { + path := "/v3/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListStat200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/stats/api_service.go b/rest/api/v3/stats/api_service.go new file mode 100644 index 00000000..29d8f9f5 --- /dev/null +++ b/rest/api/v3/stats/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/stats/docs/AdvancedStatsClicks.md b/rest/api/v3/stats/docs/AdvancedStatsClicks.md new file mode 100644 index 00000000..3f2f87ae --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsClicks.md @@ -0,0 +1,12 @@ +# AdvancedStatsClicks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clicks** | **int32** | The number of links that were clicked in your emails. |[optional] +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/AdvancedStatsClicksOpens.md b/rest/api/v3/stats/docs/AdvancedStatsClicksOpens.md new file mode 100644 index 00000000..38d8c2e1 --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsClicksOpens.md @@ -0,0 +1,14 @@ +# AdvancedStatsClicksOpens + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clicks** | **int32** | The number of links that were clicked in your emails. |[optional] +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. |[optional] +**Opens** | **int32** | The total number of times your emails were opened by recipients. |[optional] +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/AdvancedStatsMailboxProvider.md b/rest/api/v3/stats/docs/AdvancedStatsMailboxProvider.md new file mode 100644 index 00000000..403c4943 --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsMailboxProvider.md @@ -0,0 +1,18 @@ +# AdvancedStatsMailboxProvider + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. |[optional] +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. |[optional] +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. |[optional] +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. |[optional] +**Drops** | **int32** | The number of emails that were not delivered due to the recipient email address being on a suppression list. |[optional] +**Requests** | **int32** | The number of emails that were requested to be delivered. |[optional] +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the Web API that SendGrid processed. |[optional] +**SpamReports** | **int32** | The number of recipients who marked your email as spam. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/AdvancedStatsOpens.md b/rest/api/v3/stats/docs/AdvancedStatsOpens.md new file mode 100644 index 00000000..ebab3e99 --- /dev/null +++ b/rest/api/v3/stats/docs/AdvancedStatsOpens.md @@ -0,0 +1,12 @@ +# AdvancedStatsOpens + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Opens** | **int32** | The total number of times your emails were opened by recipients. |[optional] +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/AggregatedBy.md b/rest/api/v3/stats/docs/AggregatedBy.md new file mode 100644 index 00000000..96f02c9f --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy.md @@ -0,0 +1,14 @@ +# AggregatedBy + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/AggregatedBy1.md b/rest/api/v3/stats/docs/AggregatedBy1.md new file mode 100644 index 00000000..b34f829d --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy1.md @@ -0,0 +1,14 @@ +# AggregatedBy1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/AggregatedBy2.md b/rest/api/v3/stats/docs/AggregatedBy2.md new file mode 100644 index 00000000..9bf04eed --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy2.md @@ -0,0 +1,14 @@ +# AggregatedBy2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/AggregatedBy3.md b/rest/api/v3/stats/docs/AggregatedBy3.md new file mode 100644 index 00000000..7504b230 --- /dev/null +++ b/rest/api/v3/stats/docs/AggregatedBy3.md @@ -0,0 +1,14 @@ +# AggregatedBy3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/CategoryStats.md b/rest/api/v3/stats/docs/CategoryStats.md new file mode 100644 index 00000000..2b136fe2 --- /dev/null +++ b/rest/api/v3/stats/docs/CategoryStats.md @@ -0,0 +1,12 @@ +# CategoryStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date the statistics were gathered. | +**Stats** | [**[]CategoryStatsStatsInner**](CategoryStatsStatsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/CategoryStatsStatsInner.md b/rest/api/v3/stats/docs/CategoryStatsStatsInner.md new file mode 100644 index 00000000..9c188e0c --- /dev/null +++ b/rest/api/v3/stats/docs/CategoryStatsStatsInner.md @@ -0,0 +1,13 @@ +# CategoryStatsStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metrics** | [**CategoryStatsStatsInnerMetrics**](CategoryStatsStatsInnerMetrics.md) | |[optional] +**Name** | **string** | The name of the category. |[optional] +**Type** | **string** | How you are segmenting your statistics. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/CategoryStatsStatsInnerMetrics.md b/rest/api/v3/stats/docs/CategoryStatsStatsInnerMetrics.md new file mode 100644 index 00000000..8129c1f4 --- /dev/null +++ b/rest/api/v3/stats/docs/CategoryStatsStatsInnerMetrics.md @@ -0,0 +1,26 @@ +# CategoryStatsStatsInnerMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. | +**BounceDrops** | **int32** | The number of emails that were dropped because of a bounce. | +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. | +**Clicks** | **int32** | The number of links that were clicked. | +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. | +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. | +**InvalidEmails** | **int32** | The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. | +**Opens** | **int32** | The total number of times your emails were opened by recipients. | +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. | +**Requests** | **int32** | The number of emails that were requested to be delivered. | +**SpamReportDrops** | **int32** | The number of emails that were dropped due to a recipient previously marking your emails as spam. | +**SpamReports** | **int32** | The number of recipients who marked your email as spam. | +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. | +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. | +**UnsubscribeDrops** | **int32** | The number of emails dropped due to a recipient unsubscribing from your emails. | +**Unsubscribes** | **int32** | The number of recipients who unsubscribed from your emails. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ClientType.md b/rest/api/v3/stats/docs/ClientType.md new file mode 100644 index 00000000..8a7f8487 --- /dev/null +++ b/rest/api/v3/stats/docs/ClientType.md @@ -0,0 +1,15 @@ +# ClientType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**PHONE** | string | (value: `"phone"`) +**TABLET** | string | (value: `"tablet"`) +**WEBMAIL** | string | (value: `"webmail"`) +**DESKTOP** | string | (value: `"desktop"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/Country.md b/rest/api/v3/stats/docs/Country.md new file mode 100644 index 00000000..00c5f179 --- /dev/null +++ b/rest/api/v3/stats/docs/Country.md @@ -0,0 +1,13 @@ +# Country + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**US** | string | (value: `"US"`) +**CA** | string | (value: `"CA"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/GetClientStat.md b/rest/api/v3/stats/docs/GetClientStat.md new file mode 100644 index 00000000..bdd7639d --- /dev/null +++ b/rest/api/v3/stats/docs/GetClientStat.md @@ -0,0 +1,54 @@ +# GetClientStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetClientStat**](GetClientStat.md#GetClientStat) | **Get** /v3/clients/{ClientType}/stats | Retrieve stats by a specific client type. + + + +## GetClientStat + +> []ListClientStat200ResponseInner GetClientStat(ctx, StartDateClientTypeoptional) + +Retrieve stats by a specific client type. + +**This endpoint allows you to retrieve your email statistics segmented by a specific client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ### Available Client Types - phone - tablet - webmail - desktop Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**ClientType** | [**ClientType**](ClientType.md) | Specifies the type of client to retrieve stats for. Must be either \"phone\", \"tablet\", \"webmail\", or \"desktop\". + +### Other Parameters + +Other parameters are passed through a pointer to a GetClientStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**AggregatedBy** | [**AggregatedBy2**](AggregatedBy2AggregatedBy2.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". + +### Return type + +[**[]ListClientStat200ResponseInner**](ListClientStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListBrowserStat.md b/rest/api/v3/stats/docs/ListBrowserStat.md new file mode 100644 index 00000000..00b5d584 --- /dev/null +++ b/rest/api/v3/stats/docs/ListBrowserStat.md @@ -0,0 +1,53 @@ +# ListBrowserStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListBrowserStat**](ListBrowserStat.md#ListBrowserStat) | **Get** /v3/browsers/stats | Retrieve email statistics by browser. + + + +## ListBrowserStat + +> []ListBrowserStat200ResponseInner ListBrowserStat(ctx, StartDateoptional) + +Retrieve email statistics by browser. + +**This endpoint allows you to retrieve your email statistics segmented by browser type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListBrowserStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Browsers** | **string** | The browsers to get statistics for. You can include up to 10 different browsers by including this parameter multiple times. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListBrowserStat200ResponseInner**](ListBrowserStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListBrowserStat200ResponseInner.md b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInner.md new file mode 100644 index 00000000..b4f98ab1 --- /dev/null +++ b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListBrowserStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListBrowserStat200ResponseInnerStatsInner**](ListBrowserStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListBrowserStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..42ea5d07 --- /dev/null +++ b/rest/api/v3/stats/docs/ListBrowserStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListBrowserStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsClicks**](AdvancedStatsClicks.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListCategory.md b/rest/api/v3/stats/docs/ListCategory.md new file mode 100644 index 00000000..02a75cbb --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory.md @@ -0,0 +1,51 @@ +# ListCategory + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCategory**](ListCategory.md#ListCategory) | **Get** /v3/categories | Retrieve all categories + + + +## ListCategory + +> []ListCategory200ResponseInner ListCategory(ctx, optional) + +Retrieve all categories + +**This endpoint allows you to retrieve a paginated list of all of your categories.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCategoryParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Category** | **string** | Allows you to perform a prefix search on this particular category. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]ListCategory200ResponseInner**](ListCategory200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListCategory200ResponseInner.md b/rest/api/v3/stats/docs/ListCategory200ResponseInner.md new file mode 100644 index 00000000..528bed33 --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory200ResponseInner.md @@ -0,0 +1,11 @@ +# ListCategory200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | **string** | A category used to group emails by broad topic. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListCategory400Response.md b/rest/api/v3/stats/docs/ListCategory400Response.md new file mode 100644 index 00000000..1163a96f --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory400Response.md @@ -0,0 +1,11 @@ +# ListCategory400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListCategory400ResponseErrorsInner**](ListCategory400ResponseErrorsInner.md) | The error returned. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListCategory400ResponseErrorsInner.md b/rest/api/v3/stats/docs/ListCategory400ResponseErrorsInner.md new file mode 100644 index 00000000..413c97ee --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategory400ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# ListCategory400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | | +**Message** | **string** | A message explaining why your categories could not be retrieved. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListCategoryStat.md b/rest/api/v3/stats/docs/ListCategoryStat.md new file mode 100644 index 00000000..715c2215 --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategoryStat.md @@ -0,0 +1,50 @@ +# ListCategoryStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCategoryStat**](ListCategoryStat.md#ListCategoryStat) | **Get** /v3/categories/stats | Retrieve Email Statistics for Categories + + + +## ListCategoryStat + +> []CategoryStats ListCategoryStat(ctx, StartDateCategoriesoptional) + +Retrieve Email Statistics for Categories + +**This endpoint allows you to retrieve all of your email statistics for each of your categories.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCategoryStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**AggregatedBy** | [**AggregatedBy**](AggregatedByAggregatedBy.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]CategoryStats**](CategoryStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListCategoryStatSum.md b/rest/api/v3/stats/docs/ListCategoryStatSum.md new file mode 100644 index 00000000..18067fc6 --- /dev/null +++ b/rest/api/v3/stats/docs/ListCategoryStatSum.md @@ -0,0 +1,54 @@ +# ListCategoryStatSum + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCategoryStatSum**](ListCategoryStatSum.md#ListCategoryStatSum) | **Get** /v3/categories/stats/sums | Retrieve sums of email stats for each category. + + + +## ListCategoryStatSum + +> CategoryStats ListCategoryStatSum(ctx, StartDateoptional) + +Retrieve sums of email stats for each category. + +**This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.** If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCategoryStatSumParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SortByMetric** | **string** | The metric that you want to sort by. Must be a single metric. +**SortByDirection** | [**SortByDirection**](SortByDirectionSortByDirection.md) | The direction you want to sort. +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**Limit** | **int32** | Limits the number of results returned. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy1**](AggregatedBy1AggregatedBy1.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**CategoryStats**](CategoryStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListClientStat.md b/rest/api/v3/stats/docs/ListClientStat.md new file mode 100644 index 00000000..12cd3294 --- /dev/null +++ b/rest/api/v3/stats/docs/ListClientStat.md @@ -0,0 +1,50 @@ +# ListClientStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListClientStat**](ListClientStat.md#ListClientStat) | **Get** /v3/clients/stats | Retrieve email statistics by client type. + + + +## ListClientStat + +> []ListClientStat200ResponseInner ListClientStat(ctx, StartDateoptional) + +Retrieve email statistics by client type. + +**This endpoint allows you to retrieve your email statistics segmented by client type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListClientStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**AggregatedBy** | [**AggregatedBy2**](AggregatedBy2AggregatedBy2.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". + +### Return type + +[**[]ListClientStat200ResponseInner**](ListClientStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListClientStat200ResponseInner.md b/rest/api/v3/stats/docs/ListClientStat200ResponseInner.md new file mode 100644 index 00000000..dfc7e624 --- /dev/null +++ b/rest/api/v3/stats/docs/ListClientStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListClientStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListClientStat200ResponseInnerStatsInner**](ListClientStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListClientStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListClientStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..c065ab77 --- /dev/null +++ b/rest/api/v3/stats/docs/ListClientStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListClientStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsOpens**](AdvancedStatsOpens.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListDeviceStat.md b/rest/api/v3/stats/docs/ListDeviceStat.md new file mode 100644 index 00000000..e3f910f4 --- /dev/null +++ b/rest/api/v3/stats/docs/ListDeviceStat.md @@ -0,0 +1,52 @@ +# ListDeviceStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListDeviceStat**](ListDeviceStat.md#ListDeviceStat) | **Get** /v3/devices/stats | Retrieve email statistics by device type. + + + +## ListDeviceStat + +> []ListClientStat200ResponseInner ListDeviceStat(ctx, StartDateoptional) + +Retrieve email statistics by device type. + +**This endpoint allows you to retrieve your email statistics segmented by the device type.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Device Types | **Device** | **Description** | **Example** | |---|---|---| | Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | | Phone | A smart phone. | iPhone, Android, Blackberry, etc. | Tablet | A tablet computer. | iPad, android based tablet, etc. | | Other | An unrecognized device. | Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListDeviceStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListClientStat200ResponseInner**](ListClientStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListGeoStat.md b/rest/api/v3/stats/docs/ListGeoStat.md new file mode 100644 index 00000000..3c66f64e --- /dev/null +++ b/rest/api/v3/stats/docs/ListGeoStat.md @@ -0,0 +1,53 @@ +# ListGeoStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListGeoStat**](ListGeoStat.md#ListGeoStat) | **Get** /v3/geo/stats | Retrieve email statistics by country and state/province. + + + +## ListGeoStat + +> []ListGeoStat200ResponseInner ListGeoStat(ctx, StartDateoptional) + +Retrieve email statistics by country and state/province. + +**This endpoint allows you to retrieve your email statistics segmented by country and state/province.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://wwww.twilio.com/docs/sendgrid/ui/analytics-and-reporting/stats-overview). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListGeoStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Country** | [**Country**](CountryCountry.md) | The country you would like to see statistics for. Currently only supported for US and CA. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListGeoStat200ResponseInner**](ListGeoStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListGeoStat200ResponseInner.md b/rest/api/v3/stats/docs/ListGeoStat200ResponseInner.md new file mode 100644 index 00000000..b8b712fe --- /dev/null +++ b/rest/api/v3/stats/docs/ListGeoStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListGeoStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListGeoStat200ResponseInnerStatsInner**](ListGeoStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListGeoStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListGeoStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..059cb893 --- /dev/null +++ b/rest/api/v3/stats/docs/ListGeoStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListGeoStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsClicksOpens**](AdvancedStatsClicksOpens.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListMailboxProviderStat.md b/rest/api/v3/stats/docs/ListMailboxProviderStat.md new file mode 100644 index 00000000..6500d3a7 --- /dev/null +++ b/rest/api/v3/stats/docs/ListMailboxProviderStat.md @@ -0,0 +1,53 @@ +# ListMailboxProviderStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListMailboxProviderStat**](ListMailboxProviderStat.md#ListMailboxProviderStat) | **Get** /v3/mailbox_providers/stats | Retrieve email statistics by mailbox provider. + + + +## ListMailboxProviderStat + +> []ListMailboxProviderStat200ResponseInner ListMailboxProviderStat(ctx, StartDateoptional) + +Retrieve email statistics by mailbox provider. + +**This endpoint allows you to retrieve your email statistics segmented by recipient mailbox provider.** **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [Statistics Overview](https://sendgrid.com/docs/ui/analytics-and-reporting/stats-overview/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListMailboxProviderStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**MailboxProviders** | **string** | The mail box providers to get statistics for. You can include up to 10 by including this parameter multiple times. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListMailboxProviderStat200ResponseInner**](ListMailboxProviderStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInner.md b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInner.md new file mode 100644 index 00000000..0e9cf740 --- /dev/null +++ b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListMailboxProviderStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the statistics were gathered. |[optional] +**Stats** | [**[]ListMailboxProviderStat200ResponseInnerStatsInner**](ListMailboxProviderStat200ResponseInnerStatsInner.md) | The list of statistics. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..73748c49 --- /dev/null +++ b/rest/api/v3/stats/docs/ListMailboxProviderStat200ResponseInnerStatsInner.md @@ -0,0 +1,13 @@ +# ListMailboxProviderStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of segmentation. |[optional] +**Name** | **string** | The name of the specific segmentation. |[optional] +**Metrics** | [**AdvancedStatsMailboxProvider**](AdvancedStatsMailboxProvider.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListStat.md b/rest/api/v3/stats/docs/ListStat.md new file mode 100644 index 00000000..b0afdd99 --- /dev/null +++ b/rest/api/v3/stats/docs/ListStat.md @@ -0,0 +1,52 @@ +# ListStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListStat**](ListStat.md#ListStat) | **Get** /v3/stats | Retrieve global email statistics + + + +## ListStat + +> []ListStat200ResponseInner ListStat(ctx, StartDateoptional) + +Retrieve global email statistics + +**This endpoint allows you to retrieve all of your global email statistics between a given date range.** Parent accounts can see either aggregated stats for the parent account or aggregated stats for a subuser specified in the `on-behalf-of` header. Subuser accounts will see only their own stats. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Limit** | **int32** | The number of results to return. +**Offset** | **int32** | The point in the list to begin retrieving results. +**AggregatedBy** | [**AggregatedBy3**](AggregatedBy3AggregatedBy3.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + +### Return type + +[**[]ListStat200ResponseInner**](ListStat200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/stats/docs/ListStat200ResponseInner.md b/rest/api/v3/stats/docs/ListStat200ResponseInner.md new file mode 100644 index 00000000..e510d3d0 --- /dev/null +++ b/rest/api/v3/stats/docs/ListStat200ResponseInner.md @@ -0,0 +1,12 @@ +# ListStat200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date the stats were gathered. | +**Stats** | [**[]ListStat200ResponseInnerStatsInner**](ListStat200ResponseInnerStatsInner.md) | The individual email activity stats. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/ListStat200ResponseInnerStatsInner.md b/rest/api/v3/stats/docs/ListStat200ResponseInnerStatsInner.md new file mode 100644 index 00000000..7cfd11e2 --- /dev/null +++ b/rest/api/v3/stats/docs/ListStat200ResponseInnerStatsInner.md @@ -0,0 +1,11 @@ +# ListStat200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metrics** | [**StatsAdvancedGlobalStats**](StatsAdvancedGlobalStats.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/SortByDirection.md b/rest/api/v3/stats/docs/SortByDirection.md new file mode 100644 index 00000000..0431e9a0 --- /dev/null +++ b/rest/api/v3/stats/docs/SortByDirection.md @@ -0,0 +1,13 @@ +# SortByDirection + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DESC** | string | (value: `"desc"`) +**ASC** | string | (value: `"asc"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/docs/StatsAdvancedGlobalStats.md b/rest/api/v3/stats/docs/StatsAdvancedGlobalStats.md new file mode 100644 index 00000000..cf8ff1d7 --- /dev/null +++ b/rest/api/v3/stats/docs/StatsAdvancedGlobalStats.md @@ -0,0 +1,26 @@ +# StatsAdvancedGlobalStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Clicks** | **int32** | The number of links that were clicked in your emails. |[optional] +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. |[optional] +**Opens** | **int32** | The total number of times your emails were opened by recipients. |[optional] +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. |[optional] +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. |[optional] +**BounceDrops** | **int32** | The number of emails that were dropped because of a bounce. |[optional] +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. |[optional] +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. |[optional] +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. |[optional] +**InvalidEmails** | **int32** | The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. |[optional] +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. |[optional] +**Requests** | **int32** | The number of emails that were requested to be delivered. |[optional] +**SpamReportDrops** | **int32** | The number of emails that were dropped due to a recipient previously marking your emails as spam. |[optional] +**SpamReports** | **int32** | The number of recipients who marked your email as spam. |[optional] +**UnsubscribeDrops** | **int32** | The number of emails dropped due to a recipient unsubscribing from your emails. |[optional] +**Unsubscribes** | **int32** | The number of recipients who unsubscribed from your emails. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/stats/model_advanced_stats_clicks.go b/rest/api/v3/stats/model_advanced_stats_clicks.go new file mode 100644 index 00000000..e26aca54 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_clicks.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsClicks The individual events and their stats. +type AdvancedStatsClicks struct { + // The number of links that were clicked in your emails. + Clicks *int32 `json:"clicks,omitempty"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks *int32 `json:"unique_clicks,omitempty"` +} diff --git a/rest/api/v3/stats/model_advanced_stats_clicks_opens.go b/rest/api/v3/stats/model_advanced_stats_clicks_opens.go new file mode 100644 index 00000000..a8a339f8 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_clicks_opens.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsClicksOpens The individual events and their stats. +type AdvancedStatsClicksOpens struct { + // The number of links that were clicked in your emails. + Clicks *int32 `json:"clicks,omitempty"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks *int32 `json:"unique_clicks,omitempty"` + // The total number of times your emails were opened by recipients. + Opens *int32 `json:"opens,omitempty"` + // The number of unique recipients who opened your emails. + UniqueOpens *int32 `json:"unique_opens,omitempty"` +} diff --git a/rest/api/v3/stats/model_advanced_stats_mailbox_provider.go b/rest/api/v3/stats/model_advanced_stats_mailbox_provider.go new file mode 100644 index 00000000..ee75f598 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_mailbox_provider.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsMailboxProvider The individual events and their stats. +type AdvancedStatsMailboxProvider struct { + // The number of emails that were not allowed to be delivered by ISPs. + Blocks *int32 `json:"blocks,omitempty"` + // The number of emails that bounced instead of being delivered. + Bounces *int32 `json:"bounces,omitempty"` + // The number of emails that temporarily could not be delivered. + Deferred *int32 `json:"deferred,omitempty"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered *int32 `json:"delivered,omitempty"` + // The number of emails that were not delivered due to the recipient email address being on a suppression list. + Drops *int32 `json:"drops,omitempty"` + // The number of emails that were requested to be delivered. + Requests *int32 `json:"requests,omitempty"` + // Requests from your website, application, or mail client via SMTP Relay or the Web API that SendGrid processed. + Processed *int32 `json:"processed,omitempty"` + // The number of recipients who marked your email as spam. + SpamReports *int32 `json:"spam_reports,omitempty"` +} diff --git a/rest/api/v3/stats/model_advanced_stats_opens.go b/rest/api/v3/stats/model_advanced_stats_opens.go new file mode 100644 index 00000000..8af689e0 --- /dev/null +++ b/rest/api/v3/stats/model_advanced_stats_opens.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AdvancedStatsOpens The individual events and their stats. +type AdvancedStatsOpens struct { + // The total number of times your emails were opened by recipients. + Opens *int32 `json:"opens,omitempty"` + // The number of unique recipients who opened your emails. + UniqueOpens *int32 `json:"unique_opens,omitempty"` +} diff --git a/rest/api/v3/stats/model_aggregated_by.go b/rest/api/v3/stats/model_aggregated_by.go new file mode 100644 index 00000000..7030e628 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy the model 'AggregatedBy' +type AggregatedBy string + +// List of AggregatedBy +const ( + AGGREGATEDBY_DAY AggregatedBy = "day" + AGGREGATEDBY_WEEK AggregatedBy = "week" + AGGREGATEDBY_MONTH AggregatedBy = "month" +) diff --git a/rest/api/v3/stats/model_aggregated_by1.go b/rest/api/v3/stats/model_aggregated_by1.go new file mode 100644 index 00000000..1d03db31 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy1 the model 'AggregatedBy1' +type AggregatedBy1 string + +// List of AggregatedBy1 +const ( + AGGREGATEDBY1_DAY AggregatedBy1 = "day" + AGGREGATEDBY1_WEEK AggregatedBy1 = "week" + AGGREGATEDBY1_MONTH AggregatedBy1 = "month" +) diff --git a/rest/api/v3/stats/model_aggregated_by2.go b/rest/api/v3/stats/model_aggregated_by2.go new file mode 100644 index 00000000..d9a0ac73 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by2.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy2 the model 'AggregatedBy2' +type AggregatedBy2 string + +// List of AggregatedBy2 +const ( + AGGREGATEDBY2_DAY AggregatedBy2 = "day" + AGGREGATEDBY2_WEEK AggregatedBy2 = "week" + AGGREGATEDBY2_MONTH AggregatedBy2 = "month" +) diff --git a/rest/api/v3/stats/model_aggregated_by3.go b/rest/api/v3/stats/model_aggregated_by3.go new file mode 100644 index 00000000..f5d4b9e4 --- /dev/null +++ b/rest/api/v3/stats/model_aggregated_by3.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy3 the model 'AggregatedBy3' +type AggregatedBy3 string + +// List of AggregatedBy3 +const ( + AGGREGATEDBY3_DAY AggregatedBy3 = "day" + AGGREGATEDBY3_WEEK AggregatedBy3 = "week" + AGGREGATEDBY3_MONTH AggregatedBy3 = "month" +) diff --git a/rest/api/v3/stats/model_category_stats.go b/rest/api/v3/stats/model_category_stats.go new file mode 100644 index 00000000..67f280ca --- /dev/null +++ b/rest/api/v3/stats/model_category_stats.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStats struct for CategoryStats +type CategoryStats struct { + // The date the statistics were gathered. + Date string `json:"date"` + Stats *[]CategoryStatsStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_category_stats_stats_inner.go b/rest/api/v3/stats/model_category_stats_stats_inner.go new file mode 100644 index 00000000..9484fa58 --- /dev/null +++ b/rest/api/v3/stats/model_category_stats_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStatsStatsInner struct for CategoryStatsStatsInner +type CategoryStatsStatsInner struct { + Metrics *CategoryStatsStatsInnerMetrics `json:"metrics,omitempty"` + // The name of the category. + Name *string `json:"name,omitempty"` + // How you are segmenting your statistics. + Type string `json:"type"` +} diff --git a/rest/api/v3/stats/model_category_stats_stats_inner_metrics.go b/rest/api/v3/stats/model_category_stats_stats_inner_metrics.go new file mode 100644 index 00000000..99765698 --- /dev/null +++ b/rest/api/v3/stats/model_category_stats_stats_inner_metrics.go @@ -0,0 +1,50 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStatsStatsInnerMetrics struct for CategoryStatsStatsInnerMetrics +type CategoryStatsStatsInnerMetrics struct { + // The number of emails that were not allowed to be delivered by ISPs. + Blocks int32 `json:"blocks"` + // The number of emails that were dropped because of a bounce. + BounceDrops int32 `json:"bounce_drops"` + // The number of emails that bounced instead of being delivered. + Bounces int32 `json:"bounces"` + // The number of links that were clicked. + Clicks int32 `json:"clicks"` + // The number of emails that temporarily could not be delivered. + Deferred int32 `json:"deferred"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered int32 `json:"delivered"` + // The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. + InvalidEmails int32 `json:"invalid_emails"` + // The total number of times your emails were opened by recipients. + Opens int32 `json:"opens"` + // Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. + Processed int32 `json:"processed"` + // The number of emails that were requested to be delivered. + Requests int32 `json:"requests"` + // The number of emails that were dropped due to a recipient previously marking your emails as spam. + SpamReportDrops int32 `json:"spam_report_drops"` + // The number of recipients who marked your email as spam. + SpamReports int32 `json:"spam_reports"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks int32 `json:"unique_clicks"` + // The number of unique recipients who opened your emails. + UniqueOpens int32 `json:"unique_opens"` + // The number of emails dropped due to a recipient unsubscribing from your emails. + UnsubscribeDrops int32 `json:"unsubscribe_drops"` + // The number of recipients who unsubscribed from your emails. + Unsubscribes int32 `json:"unsubscribes"` +} diff --git a/rest/api/v3/stats/model_client_type.go b/rest/api/v3/stats/model_client_type.go new file mode 100644 index 00000000..3c36ab04 --- /dev/null +++ b/rest/api/v3/stats/model_client_type.go @@ -0,0 +1,25 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ClientType the model 'ClientType' +type ClientType string + +// List of ClientType +const ( + CLIENTTYPE_PHONE ClientType = "phone" + CLIENTTYPE_TABLET ClientType = "tablet" + CLIENTTYPE_WEBMAIL ClientType = "webmail" + CLIENTTYPE_DESKTOP ClientType = "desktop" +) diff --git a/rest/api/v3/stats/model_country.go b/rest/api/v3/stats/model_country.go new file mode 100644 index 00000000..867da48a --- /dev/null +++ b/rest/api/v3/stats/model_country.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Country the model 'Country' +type Country string + +// List of Country +const ( + COUNTRY_US Country = "US" + COUNTRY_CA Country = "CA" +) diff --git a/rest/api/v3/stats/model_list_browser_stat_200_response_inner.go b/rest/api/v3/stats/model_list_browser_stat_200_response_inner.go new file mode 100644 index 00000000..6abdbd78 --- /dev/null +++ b/rest/api/v3/stats/model_list_browser_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListBrowserStat200ResponseInner struct for ListBrowserStat200ResponseInner +type ListBrowserStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListBrowserStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_browser_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_browser_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..b33842eb --- /dev/null +++ b/rest/api/v3/stats/model_list_browser_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListBrowserStat200ResponseInnerStatsInner struct for ListBrowserStat200ResponseInnerStatsInner +type ListBrowserStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsClicks `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_category_200_response_inner.go b/rest/api/v3/stats/model_list_category_200_response_inner.go new file mode 100644 index 00000000..8b6aa73d --- /dev/null +++ b/rest/api/v3/stats/model_list_category_200_response_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCategory200ResponseInner struct for ListCategory200ResponseInner +type ListCategory200ResponseInner struct { + // A category used to group emails by broad topic. + Category string `json:"category"` +} diff --git a/rest/api/v3/stats/model_list_category_400_response.go b/rest/api/v3/stats/model_list_category_400_response.go new file mode 100644 index 00000000..1ddd6eb7 --- /dev/null +++ b/rest/api/v3/stats/model_list_category_400_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCategory400Response struct for ListCategory400Response +type ListCategory400Response struct { + // The error returned. + Errors *[]ListCategory400ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_category_400_response_errors_inner.go b/rest/api/v3/stats/model_list_category_400_response_errors_inner.go new file mode 100644 index 00000000..33dbbfe5 --- /dev/null +++ b/rest/api/v3/stats/model_list_category_400_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCategory400ResponseErrorsInner struct for ListCategory400ResponseErrorsInner +type ListCategory400ResponseErrorsInner struct { + Field string `json:"field"` + // A message explaining why your categories could not be retrieved. + Message string `json:"message"` +} diff --git a/rest/api/v3/stats/model_list_client_stat_200_response_inner.go b/rest/api/v3/stats/model_list_client_stat_200_response_inner.go new file mode 100644 index 00000000..f7f802fd --- /dev/null +++ b/rest/api/v3/stats/model_list_client_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListClientStat200ResponseInner struct for ListClientStat200ResponseInner +type ListClientStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListClientStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_client_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_client_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..fc6e6ec6 --- /dev/null +++ b/rest/api/v3/stats/model_list_client_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListClientStat200ResponseInnerStatsInner struct for ListClientStat200ResponseInnerStatsInner +type ListClientStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsOpens `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_geo_stat_200_response_inner.go b/rest/api/v3/stats/model_list_geo_stat_200_response_inner.go new file mode 100644 index 00000000..2c097da9 --- /dev/null +++ b/rest/api/v3/stats/model_list_geo_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListGeoStat200ResponseInner struct for ListGeoStat200ResponseInner +type ListGeoStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListGeoStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_geo_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_geo_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..0b755f7e --- /dev/null +++ b/rest/api/v3/stats/model_list_geo_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListGeoStat200ResponseInnerStatsInner struct for ListGeoStat200ResponseInnerStatsInner +type ListGeoStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsClicksOpens `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner.go b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner.go new file mode 100644 index 00000000..94550611 --- /dev/null +++ b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMailboxProviderStat200ResponseInner struct for ListMailboxProviderStat200ResponseInner +type ListMailboxProviderStat200ResponseInner struct { + // The date that the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]ListMailboxProviderStat200ResponseInnerStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..049a1771 --- /dev/null +++ b/rest/api/v3/stats/model_list_mailbox_provider_stat_200_response_inner_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListMailboxProviderStat200ResponseInnerStatsInner struct for ListMailboxProviderStat200ResponseInnerStatsInner +type ListMailboxProviderStat200ResponseInnerStatsInner struct { + // The type of segmentation. + Type *string `json:"type,omitempty"` + // The name of the specific segmentation. + Name *string `json:"name,omitempty"` + Metrics *AdvancedStatsMailboxProvider `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_list_stat_200_response_inner.go b/rest/api/v3/stats/model_list_stat_200_response_inner.go new file mode 100644 index 00000000..ff32341b --- /dev/null +++ b/rest/api/v3/stats/model_list_stat_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListStat200ResponseInner struct for ListStat200ResponseInner +type ListStat200ResponseInner struct { + // The date the stats were gathered. + Date string `json:"date"` + // The individual email activity stats. + Stats []ListStat200ResponseInnerStatsInner `json:"stats"` +} diff --git a/rest/api/v3/stats/model_list_stat_200_response_inner_stats_inner.go b/rest/api/v3/stats/model_list_stat_200_response_inner_stats_inner.go new file mode 100644 index 00000000..5ff7e17f --- /dev/null +++ b/rest/api/v3/stats/model_list_stat_200_response_inner_stats_inner.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListStat200ResponseInnerStatsInner struct for ListStat200ResponseInnerStatsInner +type ListStat200ResponseInnerStatsInner struct { + Metrics *StatsAdvancedGlobalStats `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/stats/model_sort_by_direction.go b/rest/api/v3/stats/model_sort_by_direction.go new file mode 100644 index 00000000..83900dd5 --- /dev/null +++ b/rest/api/v3/stats/model_sort_by_direction.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SortByDirection the model 'SortByDirection' +type SortByDirection string + +// List of SortByDirection +const ( + SORTBYDIRECTION_DESC SortByDirection = "desc" + SORTBYDIRECTION_ASC SortByDirection = "asc" +) diff --git a/rest/api/v3/stats/model_stats_advanced_global_stats.go b/rest/api/v3/stats/model_stats_advanced_global_stats.go new file mode 100644 index 00000000..1a7151de --- /dev/null +++ b/rest/api/v3/stats/model_stats_advanced_global_stats.go @@ -0,0 +1,50 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Statistics API +* The Twilio SendGrid Statistics API allows you to retrieve the various statistics related to your email program. Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from clicks and opens to looking at which browsers and mailbox providers your customers use. SendGrid has broken up statistics in specific ways so that you can get at-a-glance data, as well as the details of how your email is being used. Category statistics are available for the previous thirteen months only. See [**Statistics Overview**](https://docs.sendgrid.com/ui/analytics-and-reporting/stats-overview) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// StatsAdvancedGlobalStats struct for StatsAdvancedGlobalStats +type StatsAdvancedGlobalStats struct { + // The number of links that were clicked in your emails. + Clicks *int32 `json:"clicks,omitempty"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks *int32 `json:"unique_clicks,omitempty"` + // The total number of times your emails were opened by recipients. + Opens *int32 `json:"opens,omitempty"` + // The number of unique recipients who opened your emails. + UniqueOpens *int32 `json:"unique_opens,omitempty"` + // The number of emails that were not allowed to be delivered by ISPs. + Blocks *int32 `json:"blocks,omitempty"` + // The number of emails that were dropped because of a bounce. + BounceDrops *int32 `json:"bounce_drops,omitempty"` + // The number of emails that bounced instead of being delivered. + Bounces *int32 `json:"bounces,omitempty"` + // The number of emails that temporarily could not be delivered. + Deferred *int32 `json:"deferred,omitempty"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered *int32 `json:"delivered,omitempty"` + // The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. + InvalidEmails *int32 `json:"invalid_emails,omitempty"` + // Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. + Processed *int32 `json:"processed,omitempty"` + // The number of emails that were requested to be delivered. + Requests *int32 `json:"requests,omitempty"` + // The number of emails that were dropped due to a recipient previously marking your emails as spam. + SpamReportDrops *int32 `json:"spam_report_drops,omitempty"` + // The number of recipients who marked your email as spam. + SpamReports *int32 `json:"spam_reports,omitempty"` + // The number of emails dropped due to a recipient unsubscribing from your emails. + UnsubscribeDrops *int32 `json:"unsubscribe_drops,omitempty"` + // The number of recipients who unsubscribed from your emails. + Unsubscribes *int32 `json:"unsubscribes,omitempty"` +} diff --git a/rest/api/v3/subusers/README.md b/rest/api/v3/subusers/README.md new file mode 100644 index 00000000..69ea0a1d --- /dev/null +++ b/rest/api/v3/subusers/README.md @@ -0,0 +1,106 @@ +# Go API client for + +The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. + +You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.509910+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateSubuser* | [**CreateSubuser**](docs/CreateSubuser.md#createsubuser) | **Post** /v3/subusers | Create Subuser +*DeleteSubuser* | [**DeleteSubuser**](docs/DeleteSubuser.md#deletesubuser) | **Delete** /v3/subusers/{SubuserName} | Delete a subuser +*GetSubuserCredit* | [**GetSubuserCredit**](docs/GetSubuserCredit.md#getsubusercredit) | **Get** /v3/subusers/{SubuserName}/credits | Get the Credits for a Subuser +*ListMonthlyStat* | [**ListMonthlyStat**](docs/ListMonthlyStat.md#listmonthlystat) | **Get** /v3/subusers/stats/monthly | Retrieve monthly stats for all subusers +*ListReputation* | [**ListReputation**](docs/ListReputation.md#listreputation) | **Get** /v3/subusers/reputations | Retrieve Subuser Reputations +*ListStat* | [**ListStat**](docs/ListStat.md#liststat) | **Get** /v3/subusers/stats | Retrieve email statistics for your subusers. +*ListStatSum* | [**ListStatSum**](docs/ListStatSum.md#liststatsum) | **Get** /v3/subusers/stats/sums | Retrieve the totals for each email statistic metric for all subusers. +*ListSubuser* | [**ListSubuser**](docs/ListSubuser.md#listsubuser) | **Get** /v3/subusers | List all Subusers +*ListSubuserMonthlyStat* | [**ListSubuserMonthlyStat**](docs/ListSubuserMonthlyStat.md#listsubusermonthlystat) | **Get** /v3/subusers/{SubuserName}/stats/monthly | Retrieve the monthly email statistics for a single subuser +*UpdateSubuser* | [**UpdateSubuser**](docs/UpdateSubuser.md#updatesubuser) | **Patch** /v3/subusers/{SubuserName} | Enable/disable a subuser +*UpdateSubuserCredit* | [**UpdateSubuserCredit**](docs/UpdateSubuserCredit.md#updatesubusercredit) | **Put** /v3/subusers/{SubuserName}/credits | Update the Credits for a Subuser +*UpdateSubuserIp* | [**UpdateSubuserIp**](docs/UpdateSubuserIp.md#updatesubuserip) | **Put** /v3/subusers/{SubuserName}/ips | Update IPs assigned to a subuser +*UpdateSubuserRemainingCredit* | [**UpdateSubuserRemainingCredit**](docs/UpdateSubuserRemainingCredit.md#updatesubuserremainingcredit) | **Patch** /v3/subusers/{SubuserName}/credits/remaining | Update the remaining credits for a Subuser +*UpdateSubuserWebsiteAccess* | [**UpdateSubuserWebsiteAccess**](docs/UpdateSubuserWebsiteAccess.md#updatesubuserwebsiteaccess) | **Patch** /v3/subusers/{SubuserName}/website_access | Enable/Disable website access for a Subuser + + +## Documentation For Models + + - [AggregatedBy](AggregatedBy.md) + - [CategoryStats](CategoryStats.md) + - [CategoryStatsStatsInner](CategoryStatsStatsInner.md) + - [CategoryStatsStatsInnerMetrics](CategoryStatsStatsInnerMetrics.md) + - [CreateSubuserRequest](CreateSubuserRequest.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [ListReputation200ResponseInner](ListReputation200ResponseInner.md) + - [Region](Region.md) + - [Region1](Region1.md) + - [Region2](Region2.md) + - [Region3](Region3.md) + - [ResetFrequency](ResetFrequency.md) + - [ResetFrequency1](ResetFrequency1.md) + - [SortByDirection](SortByDirection.md) + - [SortByDirection1](SortByDirection1.md) + - [SortByDirection2](SortByDirection2.md) + - [SortByMetric](SortByMetric.md) + - [Subuser](Subuser.md) + - [SubuserCredits](SubuserCredits.md) + - [SubuserCreditsRequest](SubuserCreditsRequest.md) + - [SubuserPost](SubuserPost.md) + - [SubuserPostCreditAllocation](SubuserPostCreditAllocation.md) + - [SubuserStats](SubuserStats.md) + - [SubuserStatsStatsInner](SubuserStatsStatsInner.md) + - [SubuserStatsStatsInnerMetrics](SubuserStatsStatsInnerMetrics.md) + - [Type](Type.md) + - [Type1](Type1.md) + - [UpdateSubuserIp200Response](UpdateSubuserIp200Response.md) + - [UpdateSubuserRemainingCreditRequest](UpdateSubuserRemainingCreditRequest.md) + - [UpdateSubuserRequest](UpdateSubuserRequest.md) + - [UpdateSubuserWebsiteAccessRequest](UpdateSubuserWebsiteAccessRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/subusers/api_create_subuser.go b/rest/api/v3/subusers/api_create_subuser.go new file mode 100644 index 00000000..3421ac96 --- /dev/null +++ b/rest/api/v3/subusers/api_create_subuser.go @@ -0,0 +1,97 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateSubuserParam struct { + // + CreateSubuserRequest *CreateSubuserRequest `json:"CreateSubuserRequest,omitempty"` +} + +func (params *CreateSubuserParam) SetCreateSubuserRequest(CreateSubuserRequest CreateSubuserRequest) *CreateSubuserParam { + params.CreateSubuserRequest = &CreateSubuserRequest + return params +} + +// **This endpoint allows you to create a new subuser.** +func (c *ApiService) CreateSubuser(params *CreateSubuserParam) (interface{}, error) { + path := "/v3/subusers" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateSubuserRequest != nil { + b, err := json.Marshal(*params.CreateSubuserRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubuserPost{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_delete_subuser.go b/rest/api/v3/subusers/api_delete_subuser.go new file mode 100644 index 00000000..fcba9fa2 --- /dev/null +++ b/rest/api/v3/subusers/api_delete_subuser.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteSubuserParam struct { + // The username of the Subuser. + SubuserName *string `json:"subuser_name"` +} + +func (params *DeleteSubuserParam) SetSubuserName(SubuserName string) *DeleteSubuserParam { + params.SubuserName = &SubuserName + return params +} + +// **This endpoint allows you to delete a subuser.** This is a permanent action. Once deleted, a subuser cannot be retrieved. +func (c *ApiService) DeleteSubuser(params *DeleteSubuserParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_get_subuser_credit.go b/rest/api/v3/subusers/api_get_subuser_credit.go new file mode 100644 index 00000000..220e17ec --- /dev/null +++ b/rest/api/v3/subusers/api_get_subuser_credit.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetSubuserCreditParam struct { + // The username of the Subuser. + SubuserName *string `json:"subuser_name"` +} + +func (params *GetSubuserCreditParam) SetSubuserName(SubuserName string) *GetSubuserCreditParam { + params.SubuserName = &SubuserName + return params +} + +// **This endpoint allows you to retrieve a Credits overview for a Subuser.** +func (c *ApiService) GetSubuserCredit(params *GetSubuserCreditParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}/credits" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubuserCredits{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_list_monthly_stat.go b/rest/api/v3/subusers/api_list_monthly_stat.go new file mode 100644 index 00000000..459e4fec --- /dev/null +++ b/rest/api/v3/subusers/api_list_monthly_stat.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListMonthlyStatParam struct { + // The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD + Date *string `json:"date"` + // A substring search of your subusers. + Subuser *string `json:"subuser,omitempty"` + // The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.' + SortByMetric *SortByMetric `json:"sort_by_metric,omitempty"` + // The direction you want to sort. + SortByDirection *SortByDirection1 `json:"sort_by_direction,omitempty"` + // Optional field to limit the number of results returned. + Limit *int32 `json:"limit,omitempty"` + // Optional beginning point in the list to retrieve from. + Offset *int32 `json:"offset,omitempty"` +} + +func (params *ListMonthlyStatParam) SetDate(Date string) *ListMonthlyStatParam { + params.Date = &Date + return params +} +func (params *ListMonthlyStatParam) SetSubuser(Subuser string) *ListMonthlyStatParam { + params.Subuser = &Subuser + return params +} +func (params *ListMonthlyStatParam) SetSortByMetric(SortByMetric SortByMetric) *ListMonthlyStatParam { + params.SortByMetric = &SortByMetric + return params +} +func (params *ListMonthlyStatParam) SetSortByDirection(SortByDirection SortByDirection1) *ListMonthlyStatParam { + params.SortByDirection = &SortByDirection + return params +} +func (params *ListMonthlyStatParam) SetLimit(Limit int32) *ListMonthlyStatParam { + params.Limit = &Limit + return params +} +func (params *ListMonthlyStatParam) SetOffset(Offset int32) *ListMonthlyStatParam { + params.Offset = &Offset + return params +} + +// **This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +func (c *ApiService) ListMonthlyStat(params *ListMonthlyStatParam) (interface{}, error) { + path := "/v3/subusers/stats/monthly" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Date != nil { + data.Set("date", *params.Date) + } + if params != nil && params.Subuser != nil { + data.Set("subuser", *params.Subuser) + } + if params != nil && params.SortByMetric != nil { + data.Set("sort_by_metric", fmt.Sprint(*params.SortByMetric)) + } + if params != nil && params.SortByDirection != nil { + data.Set("sort_by_direction", fmt.Sprint(*params.SortByDirection)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubuserStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_list_reputation.go b/rest/api/v3/subusers/api_list_reputation.go new file mode 100644 index 00000000..dd0981dd --- /dev/null +++ b/rest/api/v3/subusers/api_list_reputation.go @@ -0,0 +1,60 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListReputationParam struct { + // + Usernames *string `json:"usernames,omitempty"` +} + +func (params *ListReputationParam) SetUsernames(Usernames string) *ListReputationParam { + params.Usernames = &Usernames + return params +} + +// **This endpoint allows you to request the reputations for your subusers.** Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will affect your sender rating. +func (c *ApiService) ListReputation(params *ListReputationParam) (interface{}, error) { + path := "/v3/subusers/reputations" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Usernames != nil { + data.Set("usernames", *params.Usernames) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListReputation200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_list_stat.go b/rest/api/v3/subusers/api_list_stat.go new file mode 100644 index 00000000..29db8ba9 --- /dev/null +++ b/rest/api/v3/subusers/api_list_stat.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListStatParam struct { + // The subuser you want to retrieve statistics for. You may include this parameter up to 10 times to retrieve statistics for multiple subusers. + Subusers *string `json:"subusers"` + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // Limits the number of results returned per page. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results from. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Must be either \"day\", \"week\", or \"month\". + AggregatedBy *AggregatedBy `json:"aggregated_by,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. + EndDate *string `json:"end_date,omitempty"` +} + +func (params *ListStatParam) SetSubusers(Subusers string) *ListStatParam { + params.Subusers = &Subusers + return params +} +func (params *ListStatParam) SetStartDate(StartDate string) *ListStatParam { + params.StartDate = &StartDate + return params +} +func (params *ListStatParam) SetLimit(Limit int32) *ListStatParam { + params.Limit = &Limit + return params +} +func (params *ListStatParam) SetOffset(Offset int32) *ListStatParam { + params.Offset = &Offset + return params +} +func (params *ListStatParam) SetAggregatedBy(AggregatedBy AggregatedBy) *ListStatParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListStatParam) SetEndDate(EndDate string) *ListStatParam { + params.EndDate = &EndDate + return params +} + +// **This endpoint allows you to retrieve the email statistics for the given subusers.** You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser. +func (c *ApiService) ListStat(params *ListStatParam) (interface{}, error) { + path := "/v3/subusers/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Subusers != nil { + data.Set("subusers", *params.Subusers) + } + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]CategoryStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_list_stat_sum.go b/rest/api/v3/subusers/api_list_stat_sum.go new file mode 100644 index 00000000..31a791fa --- /dev/null +++ b/rest/api/v3/subusers/api_list_stat_sum.go @@ -0,0 +1,115 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListStatSumParam struct { + // The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD. + StartDate *string `json:"start_date"` + // The direction you want to sort. + SortByDirection *SortByDirection2 `json:"sort_by_direction,omitempty"` + // The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. + EndDate *string `json:"end_date,omitempty"` + // Limits the number of results returned per page. + Limit *int32 `json:"limit,omitempty"` + // The point in the list to begin retrieving results from. + Offset *int32 `json:"offset,omitempty"` + // How to group the statistics. Defaults to today. Must follow format YYYY-MM-DD. + AggregatedBy *string `json:"aggregated_by,omitempty"` + // The metric that you want to sort by. Must be a single metric. + SortByMetric *string `json:"sort_by_metric,omitempty"` +} + +func (params *ListStatSumParam) SetStartDate(StartDate string) *ListStatSumParam { + params.StartDate = &StartDate + return params +} +func (params *ListStatSumParam) SetSortByDirection(SortByDirection SortByDirection2) *ListStatSumParam { + params.SortByDirection = &SortByDirection + return params +} +func (params *ListStatSumParam) SetEndDate(EndDate string) *ListStatSumParam { + params.EndDate = &EndDate + return params +} +func (params *ListStatSumParam) SetLimit(Limit int32) *ListStatSumParam { + params.Limit = &Limit + return params +} +func (params *ListStatSumParam) SetOffset(Offset int32) *ListStatSumParam { + params.Offset = &Offset + return params +} +func (params *ListStatSumParam) SetAggregatedBy(AggregatedBy string) *ListStatSumParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListStatSumParam) SetSortByMetric(SortByMetric string) *ListStatSumParam { + params.SortByMetric = &SortByMetric + return params +} + +// **This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** +func (c *ApiService) ListStatSum(params *ListStatSumParam) (interface{}, error) { + path := "/v3/subusers/stats/sums" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.SortByDirection != nil { + data.Set("sort_by_direction", fmt.Sprint(*params.SortByDirection)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", *params.AggregatedBy) + } + if params != nil && params.SortByMetric != nil { + data.Set("sort_by_metric", *params.SortByMetric) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &CategoryStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_list_subuser.go b/rest/api/v3/subusers/api_list_subuser.go new file mode 100644 index 00000000..5e531161 --- /dev/null +++ b/rest/api/v3/subusers/api_list_subuser.go @@ -0,0 +1,105 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListSubuserParam struct { + // The username of this subuser. + Username *string `json:"username,omitempty"` + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. + Limit *int32 `json:"limit,omitempty"` + // Filter for Subusers in this region. If not provided, all Subusers will be returned. All users can also be explicitly requested by using the filter `all`. Users who are not pinned to a region will be displayed as `global`. + Region *Region `json:"region,omitempty"` + // Optional flag to include the regions of the Subusers in the response. If not provided, the region will be omitted from the response. + IncludeRegion *bool `json:"include_region,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` +} + +func (params *ListSubuserParam) SetUsername(Username string) *ListSubuserParam { + params.Username = &Username + return params +} +func (params *ListSubuserParam) SetLimit(Limit int32) *ListSubuserParam { + params.Limit = &Limit + return params +} +func (params *ListSubuserParam) SetRegion(Region Region) *ListSubuserParam { + params.Region = &Region + return params +} +func (params *ListSubuserParam) SetIncludeRegion(IncludeRegion bool) *ListSubuserParam { + params.IncludeRegion = &IncludeRegion + return params +} +func (params *ListSubuserParam) SetOffset(Offset int32) *ListSubuserParam { + params.Offset = &Offset + return params +} + +// **This endpoint allows you to retrieve a paginated list of all your subusers.** You can use the `username` query parameter to filter the list for specific subusers. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListSubuser(params *ListSubuserParam) (interface{}, error) { + path := "/v3/subusers" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Region != nil { + data.Set("region", fmt.Sprint(*params.Region)) + } + if params != nil && params.IncludeRegion != nil { + data.Set("include_region", fmt.Sprint(*params.IncludeRegion)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]Subuser{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_list_subuser_monthly_stat.go b/rest/api/v3/subusers/api_list_subuser_monthly_stat.go new file mode 100644 index 00000000..84c5f03e --- /dev/null +++ b/rest/api/v3/subusers/api_list_subuser_monthly_stat.go @@ -0,0 +1,108 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ListSubuserMonthlyStatParam struct { + // The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD + Date *string `json:"date"` + // The username of the Subuser. + SubuserName *string `json:"subuser_name"` + // The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.' + SortByMetric *string `json:"sort_by_metric,omitempty"` + // The direction you want to sort. + SortByDirection *SortByDirection `json:"sort_by_direction,omitempty"` + // Optional field to limit the number of results returned. + Limit *int32 `json:"limit,omitempty"` + // Optional beginning point in the list to retrieve from. + Offset *int32 `json:"offset,omitempty"` +} + +func (params *ListSubuserMonthlyStatParam) SetDate(Date string) *ListSubuserMonthlyStatParam { + params.Date = &Date + return params +} +func (params *ListSubuserMonthlyStatParam) SetSubuserName(SubuserName string) *ListSubuserMonthlyStatParam { + params.SubuserName = &SubuserName + return params +} +func (params *ListSubuserMonthlyStatParam) SetSortByMetric(SortByMetric string) *ListSubuserMonthlyStatParam { + params.SortByMetric = &SortByMetric + return params +} +func (params *ListSubuserMonthlyStatParam) SetSortByDirection(SortByDirection SortByDirection) *ListSubuserMonthlyStatParam { + params.SortByDirection = &SortByDirection + return params +} +func (params *ListSubuserMonthlyStatParam) SetLimit(Limit int32) *ListSubuserMonthlyStatParam { + params.Limit = &Limit + return params +} +func (params *ListSubuserMonthlyStatParam) SetOffset(Offset int32) *ListSubuserMonthlyStatParam { + params.Offset = &Offset + return params +} + +// **This endpoint allows you to retrive the monthly email statistics for a specific subuser.** When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. +func (c *ApiService) ListSubuserMonthlyStat(params *ListSubuserMonthlyStatParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}/stats/monthly" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Date != nil { + data.Set("date", *params.Date) + } + if params != nil && params.SortByMetric != nil { + data.Set("sort_by_metric", *params.SortByMetric) + } + if params != nil && params.SortByDirection != nil { + data.Set("sort_by_direction", fmt.Sprint(*params.SortByDirection)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubuserStats{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_service.go b/rest/api/v3/subusers/api_service.go new file mode 100644 index 00000000..7169b7eb --- /dev/null +++ b/rest/api/v3/subusers/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/subusers/api_update_subuser.go b/rest/api/v3/subusers/api_update_subuser.go new file mode 100644 index 00000000..55d2254f --- /dev/null +++ b/rest/api/v3/subusers/api_update_subuser.go @@ -0,0 +1,100 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSubuserParam struct { + // The username of the Subuser. + SubuserName *string `json:"subuser_name"` + // + UpdateSubuserRequest *UpdateSubuserRequest `json:"UpdateSubuserRequest,omitempty"` +} + +func (params *UpdateSubuserParam) SetSubuserName(SubuserName string) *UpdateSubuserParam { + params.SubuserName = &SubuserName + return params +} +func (params *UpdateSubuserParam) SetUpdateSubuserRequest(UpdateSubuserRequest UpdateSubuserRequest) *UpdateSubuserParam { + params.UpdateSubuserRequest = &UpdateSubuserRequest + return params +} + +// **This endpoint allows you to enable or disable a subuser.** +func (c *ApiService) UpdateSubuser(params *UpdateSubuserParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateSubuserRequest != nil { + b, err := json.Marshal(*params.UpdateSubuserRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_update_subuser_credit.go b/rest/api/v3/subusers/api_update_subuser_credit.go new file mode 100644 index 00000000..9210a304 --- /dev/null +++ b/rest/api/v3/subusers/api_update_subuser_credit.go @@ -0,0 +1,84 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSubuserCreditParam struct { + // The username of the Subuser. + SubuserName *string `json:"subuser_name"` + // + SubuserCreditsRequest *SubuserCreditsRequest `json:"SubuserCreditsRequest"` +} + +func (params *UpdateSubuserCreditParam) SetSubuserName(SubuserName string) *UpdateSubuserCreditParam { + params.SubuserName = &SubuserName + return params +} +func (params *UpdateSubuserCreditParam) SetSubuserCreditsRequest(SubuserCreditsRequest SubuserCreditsRequest) *UpdateSubuserCreditParam { + params.SubuserCreditsRequest = &SubuserCreditsRequest + return params +} + +// **This endpoint allows you to update the Credits for a Subuser.** +func (c *ApiService) UpdateSubuserCredit(params *UpdateSubuserCreditParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}/credits" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SubuserCreditsRequest != nil { + b, err := json.Marshal(*params.SubuserCreditsRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubuserCredits{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_update_subuser_ip.go b/rest/api/v3/subusers/api_update_subuser_ip.go new file mode 100644 index 00000000..62ad065c --- /dev/null +++ b/rest/api/v3/subusers/api_update_subuser_ip.go @@ -0,0 +1,84 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSubuserIpParam struct { + // The username of the Subuser. + SubuserName *string `json:"subuser_name"` + // + RequestBody *[]string `json:"request_body,omitempty"` +} + +func (params *UpdateSubuserIpParam) SetSubuserName(SubuserName string) *UpdateSubuserIpParam { + params.SubuserName = &SubuserName + return params +} +func (params *UpdateSubuserIpParam) SetRequestBody(RequestBody []string) *UpdateSubuserIpParam { + params.RequestBody = &RequestBody + return params +} + +// **This endpoint allows you update your subusers' assigned IP.** Each subuser should be assigned to an IP address from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have one or more of their own IP addresses as well. More information: * [How to request more IPs](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) * [Setup Reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) +func (c *ApiService) UpdateSubuserIp(params *UpdateSubuserIpParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}/ips" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.RequestBody != nil { + b, err := json.Marshal(*params.RequestBody) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateSubuserIp200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_update_subuser_remaining_credit.go b/rest/api/v3/subusers/api_update_subuser_remaining_credit.go new file mode 100644 index 00000000..4e34d1d1 --- /dev/null +++ b/rest/api/v3/subusers/api_update_subuser_remaining_credit.go @@ -0,0 +1,84 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSubuserRemainingCreditParam struct { + // The username of the Subuser. + SubuserName *string `json:"subuser_name"` + // + UpdateSubuserRemainingCreditRequest *UpdateSubuserRemainingCreditRequest `json:"UpdateSubuserRemainingCreditRequest"` +} + +func (params *UpdateSubuserRemainingCreditParam) SetSubuserName(SubuserName string) *UpdateSubuserRemainingCreditParam { + params.SubuserName = &SubuserName + return params +} +func (params *UpdateSubuserRemainingCreditParam) SetUpdateSubuserRemainingCreditRequest(UpdateSubuserRemainingCreditRequest UpdateSubuserRemainingCreditRequest) *UpdateSubuserRemainingCreditParam { + params.UpdateSubuserRemainingCreditRequest = &UpdateSubuserRemainingCreditRequest + return params +} + +// **This endpoint allows you to update the remaining credits for a Subuser.** +func (c *ApiService) UpdateSubuserRemainingCredit(params *UpdateSubuserRemainingCreditParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}/credits/remaining" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateSubuserRemainingCreditRequest != nil { + b, err := json.Marshal(*params.UpdateSubuserRemainingCreditRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubuserCredits{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/api_update_subuser_website_access.go b/rest/api/v3/subusers/api_update_subuser_website_access.go new file mode 100644 index 00000000..54e3572a --- /dev/null +++ b/rest/api/v3/subusers/api_update_subuser_website_access.go @@ -0,0 +1,76 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSubuserWebsiteAccessParam struct { + // + SubuserName *string `json:"subuser_name"` + // + UpdateSubuserWebsiteAccessRequest *UpdateSubuserWebsiteAccessRequest `json:"UpdateSubuserWebsiteAccessRequest,omitempty"` +} + +func (params *UpdateSubuserWebsiteAccessParam) SetSubuserName(SubuserName string) *UpdateSubuserWebsiteAccessParam { + params.SubuserName = &SubuserName + return params +} +func (params *UpdateSubuserWebsiteAccessParam) SetUpdateSubuserWebsiteAccessRequest(UpdateSubuserWebsiteAccessRequest UpdateSubuserWebsiteAccessRequest) *UpdateSubuserWebsiteAccessParam { + params.UpdateSubuserWebsiteAccessRequest = &UpdateSubuserWebsiteAccessRequest + return params +} + +// Enable/Disable website access for a Subuser, while still preserving email send functionality. +func (c *ApiService) UpdateSubuserWebsiteAccess(params *UpdateSubuserWebsiteAccessParam) (interface{}, error) { + path := "/v3/subusers/{SubuserName}/website_access" + if params != nil && params.SubuserName != nil { + path = strings.Replace(path, "{"+"SubuserName"+"}", *params.SubuserName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateSubuserWebsiteAccessRequest != nil { + b, err := json.Marshal(*params.UpdateSubuserWebsiteAccessRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/subusers/docs/AggregatedBy.md b/rest/api/v3/subusers/docs/AggregatedBy.md new file mode 100644 index 00000000..96f02c9f --- /dev/null +++ b/rest/api/v3/subusers/docs/AggregatedBy.md @@ -0,0 +1,14 @@ +# AggregatedBy + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/CategoryStats.md b/rest/api/v3/subusers/docs/CategoryStats.md new file mode 100644 index 00000000..2b136fe2 --- /dev/null +++ b/rest/api/v3/subusers/docs/CategoryStats.md @@ -0,0 +1,12 @@ +# CategoryStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date the statistics were gathered. | +**Stats** | [**[]CategoryStatsStatsInner**](CategoryStatsStatsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/CategoryStatsStatsInner.md b/rest/api/v3/subusers/docs/CategoryStatsStatsInner.md new file mode 100644 index 00000000..9c188e0c --- /dev/null +++ b/rest/api/v3/subusers/docs/CategoryStatsStatsInner.md @@ -0,0 +1,13 @@ +# CategoryStatsStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metrics** | [**CategoryStatsStatsInnerMetrics**](CategoryStatsStatsInnerMetrics.md) | |[optional] +**Name** | **string** | The name of the category. |[optional] +**Type** | **string** | How you are segmenting your statistics. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/CategoryStatsStatsInnerMetrics.md b/rest/api/v3/subusers/docs/CategoryStatsStatsInnerMetrics.md new file mode 100644 index 00000000..8129c1f4 --- /dev/null +++ b/rest/api/v3/subusers/docs/CategoryStatsStatsInnerMetrics.md @@ -0,0 +1,26 @@ +# CategoryStatsStatsInnerMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. | +**BounceDrops** | **int32** | The number of emails that were dropped because of a bounce. | +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. | +**Clicks** | **int32** | The number of links that were clicked. | +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. | +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. | +**InvalidEmails** | **int32** | The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. | +**Opens** | **int32** | The total number of times your emails were opened by recipients. | +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. | +**Requests** | **int32** | The number of emails that were requested to be delivered. | +**SpamReportDrops** | **int32** | The number of emails that were dropped due to a recipient previously marking your emails as spam. | +**SpamReports** | **int32** | The number of recipients who marked your email as spam. | +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. | +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. | +**UnsubscribeDrops** | **int32** | The number of emails dropped due to a recipient unsubscribing from your emails. | +**Unsubscribes** | **int32** | The number of recipients who unsubscribed from your emails. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/CreateSubuser.md b/rest/api/v3/subusers/docs/CreateSubuser.md new file mode 100644 index 00000000..9c47f779 --- /dev/null +++ b/rest/api/v3/subusers/docs/CreateSubuser.md @@ -0,0 +1,48 @@ +# CreateSubuser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSubuser**](CreateSubuser.md#CreateSubuser) | **Post** /v3/subusers | Create Subuser + + + +## CreateSubuser + +> SubuserPost CreateSubuser(ctx, optional) + +Create Subuser + +**This endpoint allows you to create a new subuser.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateSubuserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**CreateSubuserRequest** | [**CreateSubuserRequest**](CreateSubuserRequest.md) | + +### Return type + +[**SubuserPost**](SubuserPost.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/CreateSubuserRequest.md b/rest/api/v3/subusers/docs/CreateSubuserRequest.md new file mode 100644 index 00000000..c8f80d78 --- /dev/null +++ b/rest/api/v3/subusers/docs/CreateSubuserRequest.md @@ -0,0 +1,16 @@ +# CreateSubuserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | The username for this subuser. | +**Email** | **string** | The email address of the subuser. | +**Password** | **string** | The password this subuser will use when logging into SendGrid. | +**Ips** | **[]string** | The IP addresses that should be assigned to this subuser. | +**Region** | [**Region1**](Region1.md) | The region this Subuser should be assigned to. Can be `global` or `eu`. (Regional email is in Public Beta and requires SendGrid Pro plan or above.). |[optional] +**IncludeRegion** | **bool** | A flag that determines if the Subuser's region should be returned in the response. (Regional email is in Public Beta and requires SendGrid Pro plan or above.) |[optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/DeleteSubuser.md b/rest/api/v3/subusers/docs/DeleteSubuser.md new file mode 100644 index 00000000..5be2931f --- /dev/null +++ b/rest/api/v3/subusers/docs/DeleteSubuser.md @@ -0,0 +1,51 @@ +# DeleteSubuser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteSubuser**](DeleteSubuser.md#DeleteSubuser) | **Delete** /v3/subusers/{SubuserName} | Delete a subuser + + + +## DeleteSubuser + +> map[string]interface{} DeleteSubuser(ctx, SubuserName) + +Delete a subuser + +**This endpoint allows you to delete a subuser.** This is a permanent action. Once deleted, a subuser cannot be retrieved. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | The username of the Subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteSubuserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/ErrorResponse.md b/rest/api/v3/subusers/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/subusers/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/ErrorResponseErrorsInner.md b/rest/api/v3/subusers/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/subusers/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/GetSubuserCredit.md b/rest/api/v3/subusers/docs/GetSubuserCredit.md new file mode 100644 index 00000000..8690a1fc --- /dev/null +++ b/rest/api/v3/subusers/docs/GetSubuserCredit.md @@ -0,0 +1,51 @@ +# GetSubuserCredit + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSubuserCredit**](GetSubuserCredit.md#GetSubuserCredit) | **Get** /v3/subusers/{SubuserName}/credits | Get the Credits for a Subuser + + + +## GetSubuserCredit + +> SubuserCredits GetSubuserCredit(ctx, SubuserName) + +Get the Credits for a Subuser + +**This endpoint allows you to retrieve a Credits overview for a Subuser.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | The username of the Subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a GetSubuserCreditParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SubuserCredits**](SubuserCredits.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/ListMonthlyStat.md b/rest/api/v3/subusers/docs/ListMonthlyStat.md new file mode 100644 index 00000000..ae4d42d6 --- /dev/null +++ b/rest/api/v3/subusers/docs/ListMonthlyStat.md @@ -0,0 +1,52 @@ +# ListMonthlyStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListMonthlyStat**](ListMonthlyStat.md#ListMonthlyStat) | **Get** /v3/subusers/stats/monthly | Retrieve monthly stats for all subusers + + + +## ListMonthlyStat + +> SubuserStats ListMonthlyStat(ctx, Dateoptional) + +Retrieve monthly stats for all subusers + +**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListMonthlyStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Subuser** | **string** | A substring search of your subusers. +**SortByMetric** | [**SortByMetric**](SortByMetricSortByMetric.md) | The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.' +**SortByDirection** | [**SortByDirection1**](SortByDirection1SortByDirection1.md) | The direction you want to sort. +**Limit** | **int32** | Optional field to limit the number of results returned. +**Offset** | **int32** | Optional beginning point in the list to retrieve from. + +### Return type + +[**SubuserStats**](SubuserStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/ListReputation.md b/rest/api/v3/subusers/docs/ListReputation.md new file mode 100644 index 00000000..1142829c --- /dev/null +++ b/rest/api/v3/subusers/docs/ListReputation.md @@ -0,0 +1,48 @@ +# ListReputation + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListReputation**](ListReputation.md#ListReputation) | **Get** /v3/subusers/reputations | Retrieve Subuser Reputations + + + +## ListReputation + +> []ListReputation200ResponseInner ListReputation(ctx, optional) + +Retrieve Subuser Reputations + +**This endpoint allows you to request the reputations for your subusers.** Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will affect your sender rating. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListReputationParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Usernames** | **string** | + +### Return type + +[**[]ListReputation200ResponseInner**](ListReputation200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/ListReputation200ResponseInner.md b/rest/api/v3/subusers/docs/ListReputation200ResponseInner.md new file mode 100644 index 00000000..c2d0ef07 --- /dev/null +++ b/rest/api/v3/subusers/docs/ListReputation200ResponseInner.md @@ -0,0 +1,12 @@ +# ListReputation200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Reputation** | **float32** | The sender reputation this subuser has attained. | +**Username** | **string** | The subuser that has this reputation. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/ListStat.md b/rest/api/v3/subusers/docs/ListStat.md new file mode 100644 index 00000000..16c65e17 --- /dev/null +++ b/rest/api/v3/subusers/docs/ListStat.md @@ -0,0 +1,51 @@ +# ListStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListStat**](ListStat.md#ListStat) | **Get** /v3/subusers/stats | Retrieve email statistics for your subusers. + + + +## ListStat + +> []CategoryStats ListStat(ctx, SubusersStartDateoptional) + +Retrieve email statistics for your subusers. + +**This endpoint allows you to retrieve the email statistics for the given subusers.** You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | Limits the number of results returned per page. +**Offset** | **int32** | The point in the list to begin retrieving results from. +**AggregatedBy** | [**AggregatedBy**](AggregatedByAggregatedBy.md) | How to group the statistics. Must be either \"day\", \"week\", or \"month\". +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. + +### Return type + +[**[]CategoryStats**](CategoryStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/ListStatSum.md b/rest/api/v3/subusers/docs/ListStatSum.md new file mode 100644 index 00000000..8d801458 --- /dev/null +++ b/rest/api/v3/subusers/docs/ListStatSum.md @@ -0,0 +1,53 @@ +# ListStatSum + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListStatSum**](ListStatSum.md#ListStatSum) | **Get** /v3/subusers/stats/sums | Retrieve the totals for each email statistic metric for all subusers. + + + +## ListStatSum + +> CategoryStats ListStatSum(ctx, StartDateoptional) + +Retrieve the totals for each email statistic metric for all subusers. + +**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListStatSumParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SortByDirection** | [**SortByDirection2**](SortByDirection2SortByDirection2.md) | The direction you want to sort. +**EndDate** | **string** | The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD. +**Limit** | **int32** | Limits the number of results returned per page. +**Offset** | **int32** | The point in the list to begin retrieving results from. +**AggregatedBy** | **string** | How to group the statistics. Defaults to today. Must follow format YYYY-MM-DD. +**SortByMetric** | **string** | The metric that you want to sort by. Must be a single metric. + +### Return type + +[**CategoryStats**](CategoryStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/ListSubuser.md b/rest/api/v3/subusers/docs/ListSubuser.md new file mode 100644 index 00000000..679e08de --- /dev/null +++ b/rest/api/v3/subusers/docs/ListSubuser.md @@ -0,0 +1,52 @@ +# ListSubuser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSubuser**](ListSubuser.md#ListSubuser) | **Get** /v3/subusers | List all Subusers + + + +## ListSubuser + +> []Subuser ListSubuser(ctx, optional) + +List all Subusers + +**This endpoint allows you to retrieve a paginated list of all your subusers.** You can use the `username` query parameter to filter the list for specific subusers. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSubuserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Username** | **string** | The username of this subuser. +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. +**Region** | [**Region**](RegionRegion.md) | Filter for Subusers in this region. If not provided, all Subusers will be returned. All users can also be explicitly requested by using the filter `all`. Users who are not pinned to a region will be displayed as `global`. +**IncludeRegion** | **bool** | Optional flag to include the regions of the Subusers in the response. If not provided, the region will be omitted from the response. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + +### Return type + +[**[]Subuser**](Subuser.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/ListSubuserMonthlyStat.md b/rest/api/v3/subusers/docs/ListSubuserMonthlyStat.md new file mode 100644 index 00000000..039a19c5 --- /dev/null +++ b/rest/api/v3/subusers/docs/ListSubuserMonthlyStat.md @@ -0,0 +1,55 @@ +# ListSubuserMonthlyStat + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSubuserMonthlyStat**](ListSubuserMonthlyStat.md#ListSubuserMonthlyStat) | **Get** /v3/subusers/{SubuserName}/stats/monthly | Retrieve the monthly email statistics for a single subuser + + + +## ListSubuserMonthlyStat + +> SubuserStats ListSubuserMonthlyStat(ctx, DateSubuserNameoptional) + +Retrieve the monthly email statistics for a single subuser + +**This endpoint allows you to retrive the monthly email statistics for a specific subuser.** When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | The username of the Subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSubuserMonthlyStatParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**SortByMetric** | **string** | The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.' +**SortByDirection** | [**SortByDirection**](SortByDirectionSortByDirection.md) | The direction you want to sort. +**Limit** | **int32** | Optional field to limit the number of results returned. +**Offset** | **int32** | Optional beginning point in the list to retrieve from. + +### Return type + +[**SubuserStats**](SubuserStats.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/Region.md b/rest/api/v3/subusers/docs/Region.md new file mode 100644 index 00000000..5c815839 --- /dev/null +++ b/rest/api/v3/subusers/docs/Region.md @@ -0,0 +1,14 @@ +# Region + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ALL** | string | (value: `"all"`) +**GLOBAL** | string | (value: `"global"`) +**EU** | string | (value: `"eu"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/Region1.md b/rest/api/v3/subusers/docs/Region1.md new file mode 100644 index 00000000..53994edc --- /dev/null +++ b/rest/api/v3/subusers/docs/Region1.md @@ -0,0 +1,13 @@ +# Region1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**GLOBAL** | string | (value: `"global"`) +**EU** | string | (value: `"eu"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/Region2.md b/rest/api/v3/subusers/docs/Region2.md new file mode 100644 index 00000000..d5a099ad --- /dev/null +++ b/rest/api/v3/subusers/docs/Region2.md @@ -0,0 +1,13 @@ +# Region2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**GLOBAL** | string | (value: `"global"`) +**EU** | string | (value: `"eu"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/Region3.md b/rest/api/v3/subusers/docs/Region3.md new file mode 100644 index 00000000..32404c8e --- /dev/null +++ b/rest/api/v3/subusers/docs/Region3.md @@ -0,0 +1,13 @@ +# Region3 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**GLOBAL** | string | (value: `"global"`) +**EU** | string | (value: `"eu"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/ResetFrequency.md b/rest/api/v3/subusers/docs/ResetFrequency.md new file mode 100644 index 00000000..9b705ddc --- /dev/null +++ b/rest/api/v3/subusers/docs/ResetFrequency.md @@ -0,0 +1,14 @@ +# ResetFrequency + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**MONTHLY** | string | (value: `"monthly"`) +**WEEKLY** | string | (value: `"weekly"`) +**DAILY** | string | (value: `"daily"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/ResetFrequency1.md b/rest/api/v3/subusers/docs/ResetFrequency1.md new file mode 100644 index 00000000..1b6e357e --- /dev/null +++ b/rest/api/v3/subusers/docs/ResetFrequency1.md @@ -0,0 +1,14 @@ +# ResetFrequency1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**MONTHLY** | string | (value: `"monthly"`) +**WEEKLY** | string | (value: `"weekly"`) +**DAILY** | string | (value: `"daily"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SortByDirection.md b/rest/api/v3/subusers/docs/SortByDirection.md new file mode 100644 index 00000000..0431e9a0 --- /dev/null +++ b/rest/api/v3/subusers/docs/SortByDirection.md @@ -0,0 +1,13 @@ +# SortByDirection + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DESC** | string | (value: `"desc"`) +**ASC** | string | (value: `"asc"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SortByDirection1.md b/rest/api/v3/subusers/docs/SortByDirection1.md new file mode 100644 index 00000000..aa9dabea --- /dev/null +++ b/rest/api/v3/subusers/docs/SortByDirection1.md @@ -0,0 +1,13 @@ +# SortByDirection1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DESC** | string | (value: `"desc"`) +**ASC** | string | (value: `"asc"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SortByDirection2.md b/rest/api/v3/subusers/docs/SortByDirection2.md new file mode 100644 index 00000000..a25d133f --- /dev/null +++ b/rest/api/v3/subusers/docs/SortByDirection2.md @@ -0,0 +1,13 @@ +# SortByDirection2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DESC** | string | (value: `"desc"`) +**ASC** | string | (value: `"asc"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SortByMetric.md b/rest/api/v3/subusers/docs/SortByMetric.md new file mode 100644 index 00000000..d58e068d --- /dev/null +++ b/rest/api/v3/subusers/docs/SortByMetric.md @@ -0,0 +1,20 @@ +# SortByMetric + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**BLOCKS** | string | (value: `"blocks"`) +**BOUNCES** | string | (value: `"bounces"`) +**CLICKS** | string | (value: `"clicks"`) +**DELIVERED** | string | (value: `"delivered"`) +**OPENS** | string | (value: `"opens"`) +**REQUESTS** | string | (value: `"requests"`) +**UNIQUE_CLICKS** | string | (value: `"unique_clicks"`) +**UNIQUE_OPENS** | string | (value: `"unique_opens"`) +**UNSUBSCRIBES** | string | (value: `"unsubscribes"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/Subuser.md b/rest/api/v3/subusers/docs/Subuser.md new file mode 100644 index 00000000..5730bdb1 --- /dev/null +++ b/rest/api/v3/subusers/docs/Subuser.md @@ -0,0 +1,15 @@ +# Subuser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Disabled** | **bool** | Whether or not the user is enabled or disabled. | +**Id** | **float32** | The ID of this subuser. | +**Username** | **string** | The name by which this subuser will be referred. | +**Email** | **string** | The email address to contact this subuser. | +**Region** | [**Region2**](Region2.md) | The region this Subuser is assigned to. This property is returned only if the `include_region` parameter was included and set to `true` in the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SubuserCredits.md b/rest/api/v3/subusers/docs/SubuserCredits.md new file mode 100644 index 00000000..5d6b18a9 --- /dev/null +++ b/rest/api/v3/subusers/docs/SubuserCredits.md @@ -0,0 +1,15 @@ +# SubuserCredits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Type**](Type.md) | Type determines how credits are reset for a Subuser. `unlimited` indicates that there is no limit to the Subuser's credits. `recurring` indicates that the credits for the Subuser are reset according to the frequency determined by `reset_frequency`. `nonrecurring` indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis. | +**ResetFrequency** | [**ResetFrequency**](ResetFrequency.md) | The frequency with which a Subuser's credits are reset if `type` is set to `recurring`, otherwise `null`. | +**Remain** | **int32** | Total number of remaining credits. `remain` is `null` if the reset `type` for the Subuser's credits is set to `unlimited`. | +**Total** | **int32** | Total number of allowable credits. `total` is `null` if the reset `type` for the Subuser's credits is set to `unlimited` or `nonrecurring`. | +**Used** | **int32** | Total number of used credits. `used` is `null` if the reset `type` for the Subuser's credits is set to `unlimited` or `nonrecurring`. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SubuserCreditsRequest.md b/rest/api/v3/subusers/docs/SubuserCreditsRequest.md new file mode 100644 index 00000000..0ab5910a --- /dev/null +++ b/rest/api/v3/subusers/docs/SubuserCreditsRequest.md @@ -0,0 +1,13 @@ +# SubuserCreditsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Type1**](Type1.md) | Type determines how credits are reset for a Subuser. `unlimited` indicates that there is no limit to the Subuser's credits. `recurring` indicates that the credits for the Subuser are reset according to the frequency determined by `reset_frequency`. `nonrecurring` indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis. | +**ResetFrequency** | [**ResetFrequency1**](ResetFrequency1.md) | The frequency with which a Subuser's credits are reset if `type` is set to `recurring`. Do _not_ include `reset_frequency` if you choose a reset `type` value of `unlimited` or `nonrecurring`. |[optional] +**Total** | **int32** | Total number of credits to which the Subuser is to be reset. If `type` is `nonrecurring` then the Subuser's credits will be reset to `total` on a one-time basis. If `type` is `recurring` then the Subuser's credits will be reset to `total` every time a reset is scheduled in accordance with the `reset_frequency`. Do _not_ include `total` if you choose a reset `type` value of `unlimited`. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SubuserPost.md b/rest/api/v3/subusers/docs/SubuserPost.md new file mode 100644 index 00000000..8abc4df3 --- /dev/null +++ b/rest/api/v3/subusers/docs/SubuserPost.md @@ -0,0 +1,15 @@ +# SubuserPost + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | The username of the subuser. | +**UserId** | **float32** | The user ID for this subuser. | +**Email** | **string** | The email address for this subuser. | +**CreditAllocation** | [**SubuserPostCreditAllocation**](SubuserPostCreditAllocation.md) | |[optional] +**Region** | [**Region3**](Region3.md) | The region this Subuser is assigned to. The property is returned only if the `include_region` parameter is included and set to `true` in the API request. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SubuserPostCreditAllocation.md b/rest/api/v3/subusers/docs/SubuserPostCreditAllocation.md new file mode 100644 index 00000000..fa1e529e --- /dev/null +++ b/rest/api/v3/subusers/docs/SubuserPostCreditAllocation.md @@ -0,0 +1,11 @@ +# SubuserPostCreditAllocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SubuserStats.md b/rest/api/v3/subusers/docs/SubuserStats.md new file mode 100644 index 00000000..5ca5f9fb --- /dev/null +++ b/rest/api/v3/subusers/docs/SubuserStats.md @@ -0,0 +1,12 @@ +# SubuserStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date the statistics were gathered. |[optional] +**Stats** | [**[]SubuserStatsStatsInner**](SubuserStatsStatsInner.md) | The list of statistics. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SubuserStatsStatsInner.md b/rest/api/v3/subusers/docs/SubuserStatsStatsInner.md new file mode 100644 index 00000000..55735232 --- /dev/null +++ b/rest/api/v3/subusers/docs/SubuserStatsStatsInner.md @@ -0,0 +1,15 @@ +# SubuserStatsStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FirstName** | **string** | The first name of the subuser. |[optional] +**LastName** | **string** | The last name of the subuser. |[optional] +**Metrics** | [**SubuserStatsStatsInnerMetrics**](SubuserStatsStatsInnerMetrics.md) | |[optional] +**Name** | **string** | The username of the subuser. |[optional] +**Type** | **string** | The type of account. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/SubuserStatsStatsInnerMetrics.md b/rest/api/v3/subusers/docs/SubuserStatsStatsInnerMetrics.md new file mode 100644 index 00000000..1c7f2071 --- /dev/null +++ b/rest/api/v3/subusers/docs/SubuserStatsStatsInnerMetrics.md @@ -0,0 +1,26 @@ +# SubuserStatsStatsInnerMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Blocks** | **int32** | The number of emails that were not allowed to be delivered by ISPs. |[optional] +**BounceDrops** | **int32** | The number of emails that were dropped because of a bounce. |[optional] +**Bounces** | **int32** | The number of emails that bounced instead of being delivered. |[optional] +**Clicks** | **int32** | The number of links that were clicked in your emails. |[optional] +**Deferred** | **int32** | The number of emails that temporarily could not be delivered. |[optional] +**Delivered** | **int32** | The number of emails SendGrid was able to confirm were actually delivered to a recipient. |[optional] +**InvalidEmails** | **int32** | The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. |[optional] +**Opens** | **int32** | The total number of times your emails were opened by recipients. |[optional] +**Processed** | **int32** | Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. |[optional] +**Requests** | **int32** | The number of emails that were requested to be delivered. |[optional] +**SpamReportDrops** | **int32** | The number of emails that were dropped due to a recipient previously marking your emails as spam. |[optional] +**SpamReports** | **int32** | The number of recipients who marked your email as spam. |[optional] +**UniqueClicks** | **int32** | The number of unique recipients who clicked links in your emails. |[optional] +**UniqueOpens** | **int32** | The number of unique recipients who opened your emails. |[optional] +**UnsubscribeDrops** | **int32** | The number of emails dropped due to a recipient unsubscribing from your emails. |[optional] +**Unsubscribes** | **int32** | The number of recipients who unsubscribed from your emails. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/Type.md b/rest/api/v3/subusers/docs/Type.md new file mode 100644 index 00000000..0a33c4cf --- /dev/null +++ b/rest/api/v3/subusers/docs/Type.md @@ -0,0 +1,14 @@ +# Type + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**UNLIMITED** | string | (value: `"unlimited"`) +**RECURRING** | string | (value: `"recurring"`) +**NONRECURRING** | string | (value: `"nonrecurring"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/Type1.md b/rest/api/v3/subusers/docs/Type1.md new file mode 100644 index 00000000..929d624f --- /dev/null +++ b/rest/api/v3/subusers/docs/Type1.md @@ -0,0 +1,14 @@ +# Type1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**UNLIMITED** | string | (value: `"unlimited"`) +**RECURRING** | string | (value: `"recurring"`) +**NONRECURRING** | string | (value: `"nonrecurring"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/UpdateSubuser.md b/rest/api/v3/subusers/docs/UpdateSubuser.md new file mode 100644 index 00000000..37171280 --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuser.md @@ -0,0 +1,52 @@ +# UpdateSubuser + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSubuser**](UpdateSubuser.md#UpdateSubuser) | **Patch** /v3/subusers/{SubuserName} | Enable/disable a subuser + + + +## UpdateSubuser + +> map[string]interface{} UpdateSubuser(ctx, SubuserNameoptional) + +Enable/disable a subuser + +**This endpoint allows you to enable or disable a subuser.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | The username of the Subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSubuserParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateSubuserRequest** | [**UpdateSubuserRequest**](UpdateSubuserRequest.md) | + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserCredit.md b/rest/api/v3/subusers/docs/UpdateSubuserCredit.md new file mode 100644 index 00000000..7c5088c3 --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserCredit.md @@ -0,0 +1,51 @@ +# UpdateSubuserCredit + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSubuserCredit**](UpdateSubuserCredit.md#UpdateSubuserCredit) | **Put** /v3/subusers/{SubuserName}/credits | Update the Credits for a Subuser + + + +## UpdateSubuserCredit + +> SubuserCredits UpdateSubuserCredit(ctx, SubuserNameSubuserCreditsRequest) + +Update the Credits for a Subuser + +**This endpoint allows you to update the Credits for a Subuser.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | The username of the Subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSubuserCreditParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SubuserCredits**](SubuserCredits.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserIp.md b/rest/api/v3/subusers/docs/UpdateSubuserIp.md new file mode 100644 index 00000000..402e272e --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserIp.md @@ -0,0 +1,52 @@ +# UpdateSubuserIp + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSubuserIp**](UpdateSubuserIp.md#UpdateSubuserIp) | **Put** /v3/subusers/{SubuserName}/ips | Update IPs assigned to a subuser + + + +## UpdateSubuserIp + +> UpdateSubuserIp200Response UpdateSubuserIp(ctx, SubuserNameoptional) + +Update IPs assigned to a subuser + +**This endpoint allows you update your subusers' assigned IP.** Each subuser should be assigned to an IP address from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have one or more of their own IP addresses as well. More information: * [How to request more IPs](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) * [Setup Reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/) + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | The username of the Subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSubuserIpParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**RequestBody** | **[]string** | + +### Return type + +[**UpdateSubuserIp200Response**](UpdateSubuserIp200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserIp200Response.md b/rest/api/v3/subusers/docs/UpdateSubuserIp200Response.md new file mode 100644 index 00000000..fe663d5f --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserIp200Response.md @@ -0,0 +1,11 @@ +# UpdateSubuserIp200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ips** | **[]string** | The IP addresses that are assigned to the subuser. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserRemainingCredit.md b/rest/api/v3/subusers/docs/UpdateSubuserRemainingCredit.md new file mode 100644 index 00000000..a1a8923d --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserRemainingCredit.md @@ -0,0 +1,51 @@ +# UpdateSubuserRemainingCredit + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSubuserRemainingCredit**](UpdateSubuserRemainingCredit.md#UpdateSubuserRemainingCredit) | **Patch** /v3/subusers/{SubuserName}/credits/remaining | Update the remaining credits for a Subuser + + + +## UpdateSubuserRemainingCredit + +> SubuserCredits UpdateSubuserRemainingCredit(ctx, SubuserNameUpdateSubuserRemainingCreditRequest) + +Update the remaining credits for a Subuser + +**This endpoint allows you to update the remaining credits for a Subuser.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | The username of the Subuser. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSubuserRemainingCreditParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +[**SubuserCredits**](SubuserCredits.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserRemainingCreditRequest.md b/rest/api/v3/subusers/docs/UpdateSubuserRemainingCreditRequest.md new file mode 100644 index 00000000..4431ec58 --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserRemainingCreditRequest.md @@ -0,0 +1,11 @@ +# UpdateSubuserRemainingCreditRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllocationUpdate** | **int32** | The number of credits to add to or subtract from the current remaining credits for the Subuser. Use a positive number to increase the remaining credits or a negative number to reduce the remaining credits. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserRequest.md b/rest/api/v3/subusers/docs/UpdateSubuserRequest.md new file mode 100644 index 00000000..2a1081ef --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserRequest.md @@ -0,0 +1,11 @@ +# UpdateSubuserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Disabled** | **bool** | Whether or not this subuser is disabled. `true` means disabled, `false` means enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccess.md b/rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccess.md new file mode 100644 index 00000000..fdbf5ff8 --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccess.md @@ -0,0 +1,52 @@ +# UpdateSubuserWebsiteAccess + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSubuserWebsiteAccess**](UpdateSubuserWebsiteAccess.md#UpdateSubuserWebsiteAccess) | **Patch** /v3/subusers/{SubuserName}/website_access | Enable/Disable website access for a Subuser + + + +## UpdateSubuserWebsiteAccess + +> map[string]interface{} UpdateSubuserWebsiteAccess(ctx, SubuserNameoptional) + +Enable/Disable website access for a Subuser + +Enable/Disable website access for a Subuser, while still preserving email send functionality. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**SubuserName** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSubuserWebsiteAccessParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**UpdateSubuserWebsiteAccessRequest** | [**UpdateSubuserWebsiteAccessRequest**](UpdateSubuserWebsiteAccessRequest.md) | + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccessRequest.md b/rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccessRequest.md new file mode 100644 index 00000000..a187eb06 --- /dev/null +++ b/rest/api/v3/subusers/docs/UpdateSubuserWebsiteAccessRequest.md @@ -0,0 +1,11 @@ +# UpdateSubuserWebsiteAccessRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Disabled** | **bool** | Whether or not to disable website access to the Subuser. `true` means disabled, `false` means enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/subusers/model_aggregated_by.go b/rest/api/v3/subusers/model_aggregated_by.go new file mode 100644 index 00000000..5542cabd --- /dev/null +++ b/rest/api/v3/subusers/model_aggregated_by.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy the model 'AggregatedBy' +type AggregatedBy string + +// List of AggregatedBy +const ( + AGGREGATEDBY_DAY AggregatedBy = "day" + AGGREGATEDBY_WEEK AggregatedBy = "week" + AGGREGATEDBY_MONTH AggregatedBy = "month" +) diff --git a/rest/api/v3/subusers/model_category_stats.go b/rest/api/v3/subusers/model_category_stats.go new file mode 100644 index 00000000..1d14ce55 --- /dev/null +++ b/rest/api/v3/subusers/model_category_stats.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStats struct for CategoryStats +type CategoryStats struct { + // The date the statistics were gathered. + Date string `json:"date"` + Stats *[]CategoryStatsStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/subusers/model_category_stats_stats_inner.go b/rest/api/v3/subusers/model_category_stats_stats_inner.go new file mode 100644 index 00000000..00fba759 --- /dev/null +++ b/rest/api/v3/subusers/model_category_stats_stats_inner.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStatsStatsInner struct for CategoryStatsStatsInner +type CategoryStatsStatsInner struct { + Metrics *CategoryStatsStatsInnerMetrics `json:"metrics,omitempty"` + // The name of the category. + Name *string `json:"name,omitempty"` + // How you are segmenting your statistics. + Type string `json:"type"` +} diff --git a/rest/api/v3/subusers/model_category_stats_stats_inner_metrics.go b/rest/api/v3/subusers/model_category_stats_stats_inner_metrics.go new file mode 100644 index 00000000..a7d50efe --- /dev/null +++ b/rest/api/v3/subusers/model_category_stats_stats_inner_metrics.go @@ -0,0 +1,50 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CategoryStatsStatsInnerMetrics struct for CategoryStatsStatsInnerMetrics +type CategoryStatsStatsInnerMetrics struct { + // The number of emails that were not allowed to be delivered by ISPs. + Blocks int32 `json:"blocks"` + // The number of emails that were dropped because of a bounce. + BounceDrops int32 `json:"bounce_drops"` + // The number of emails that bounced instead of being delivered. + Bounces int32 `json:"bounces"` + // The number of links that were clicked. + Clicks int32 `json:"clicks"` + // The number of emails that temporarily could not be delivered. + Deferred int32 `json:"deferred"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered int32 `json:"delivered"` + // The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. + InvalidEmails int32 `json:"invalid_emails"` + // The total number of times your emails were opened by recipients. + Opens int32 `json:"opens"` + // Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. + Processed int32 `json:"processed"` + // The number of emails that were requested to be delivered. + Requests int32 `json:"requests"` + // The number of emails that were dropped due to a recipient previously marking your emails as spam. + SpamReportDrops int32 `json:"spam_report_drops"` + // The number of recipients who marked your email as spam. + SpamReports int32 `json:"spam_reports"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks int32 `json:"unique_clicks"` + // The number of unique recipients who opened your emails. + UniqueOpens int32 `json:"unique_opens"` + // The number of emails dropped due to a recipient unsubscribing from your emails. + UnsubscribeDrops int32 `json:"unsubscribe_drops"` + // The number of recipients who unsubscribed from your emails. + Unsubscribes int32 `json:"unsubscribes"` +} diff --git a/rest/api/v3/subusers/model_create_subuser_request.go b/rest/api/v3/subusers/model_create_subuser_request.go new file mode 100644 index 00000000..5839b599 --- /dev/null +++ b/rest/api/v3/subusers/model_create_subuser_request.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateSubuserRequest struct for CreateSubuserRequest +type CreateSubuserRequest struct { + // The username for this subuser. + Username string `json:"username"` + // The email address of the subuser. + Email string `json:"email"` + // The password this subuser will use when logging into SendGrid. + Password string `json:"password"` + // The IP addresses that should be assigned to this subuser. + Ips []string `json:"ips"` + // The region this Subuser should be assigned to. Can be `global` or `eu`. (Regional email is in Public Beta and requires SendGrid Pro plan or above.). + Region *Region1 `json:"region,omitempty"` + // A flag that determines if the Subuser's region should be returned in the response. (Regional email is in Public Beta and requires SendGrid Pro plan or above.) + IncludeRegion *bool `json:"include_region,omitempty"` +} diff --git a/rest/api/v3/subusers/model_error_response.go b/rest/api/v3/subusers/model_error_response.go new file mode 100644 index 00000000..c2d757e4 --- /dev/null +++ b/rest/api/v3/subusers/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/subusers/model_error_response_errors_inner.go b/rest/api/v3/subusers/model_error_response_errors_inner.go new file mode 100644 index 00000000..2d3ef35d --- /dev/null +++ b/rest/api/v3/subusers/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/subusers/model_list_reputation_200_response_inner.go b/rest/api/v3/subusers/model_list_reputation_200_response_inner.go new file mode 100644 index 00000000..1f50f157 --- /dev/null +++ b/rest/api/v3/subusers/model_list_reputation_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListReputation200ResponseInner struct for ListReputation200ResponseInner +type ListReputation200ResponseInner struct { + // The sender reputation this subuser has attained. + Reputation float32 `json:"reputation"` + // The subuser that has this reputation. + Username string `json:"username"` +} diff --git a/rest/api/v3/subusers/model_region.go b/rest/api/v3/subusers/model_region.go new file mode 100644 index 00000000..b7956176 --- /dev/null +++ b/rest/api/v3/subusers/model_region.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region the model 'Region' +type Region string + +// List of Region +const ( + REGION_ALL Region = "all" + REGION_GLOBAL Region = "global" + REGION_EU Region = "eu" +) diff --git a/rest/api/v3/subusers/model_region1.go b/rest/api/v3/subusers/model_region1.go new file mode 100644 index 00000000..4bd4d938 --- /dev/null +++ b/rest/api/v3/subusers/model_region1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region1 the model 'Region1' +type Region1 string + +// List of Region1 +const ( + REGION1_GLOBAL Region1 = "global" + REGION1_EU Region1 = "eu" +) diff --git a/rest/api/v3/subusers/model_region2.go b/rest/api/v3/subusers/model_region2.go new file mode 100644 index 00000000..5ae5093e --- /dev/null +++ b/rest/api/v3/subusers/model_region2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region2 the model 'Region2' +type Region2 string + +// List of Region2 +const ( + REGION2_GLOBAL Region2 = "global" + REGION2_EU Region2 = "eu" +) diff --git a/rest/api/v3/subusers/model_region3.go b/rest/api/v3/subusers/model_region3.go new file mode 100644 index 00000000..8a827cdc --- /dev/null +++ b/rest/api/v3/subusers/model_region3.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Region3 the model 'Region3' +type Region3 string + +// List of Region3 +const ( + REGION3_GLOBAL Region3 = "global" + REGION3_EU Region3 = "eu" +) diff --git a/rest/api/v3/subusers/model_reset_frequency.go b/rest/api/v3/subusers/model_reset_frequency.go new file mode 100644 index 00000000..e5725d07 --- /dev/null +++ b/rest/api/v3/subusers/model_reset_frequency.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ResetFrequency the model 'ResetFrequency' +type ResetFrequency string + +// List of ResetFrequency +const ( + RESETFREQUENCY_MONTHLY ResetFrequency = "monthly" + RESETFREQUENCY_WEEKLY ResetFrequency = "weekly" + RESETFREQUENCY_DAILY ResetFrequency = "daily" +) diff --git a/rest/api/v3/subusers/model_reset_frequency1.go b/rest/api/v3/subusers/model_reset_frequency1.go new file mode 100644 index 00000000..2f9b7e5d --- /dev/null +++ b/rest/api/v3/subusers/model_reset_frequency1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ResetFrequency1 the model 'ResetFrequency1' +type ResetFrequency1 string + +// List of ResetFrequency1 +const ( + RESETFREQUENCY1_MONTHLY ResetFrequency1 = "monthly" + RESETFREQUENCY1_WEEKLY ResetFrequency1 = "weekly" + RESETFREQUENCY1_DAILY ResetFrequency1 = "daily" +) diff --git a/rest/api/v3/subusers/model_sort_by_direction.go b/rest/api/v3/subusers/model_sort_by_direction.go new file mode 100644 index 00000000..f0372919 --- /dev/null +++ b/rest/api/v3/subusers/model_sort_by_direction.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SortByDirection the model 'SortByDirection' +type SortByDirection string + +// List of SortByDirection +const ( + SORTBYDIRECTION_DESC SortByDirection = "desc" + SORTBYDIRECTION_ASC SortByDirection = "asc" +) diff --git a/rest/api/v3/subusers/model_sort_by_direction1.go b/rest/api/v3/subusers/model_sort_by_direction1.go new file mode 100644 index 00000000..3eb12c50 --- /dev/null +++ b/rest/api/v3/subusers/model_sort_by_direction1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SortByDirection1 the model 'SortByDirection1' +type SortByDirection1 string + +// List of SortByDirection1 +const ( + SORTBYDIRECTION1_DESC SortByDirection1 = "desc" + SORTBYDIRECTION1_ASC SortByDirection1 = "asc" +) diff --git a/rest/api/v3/subusers/model_sort_by_direction2.go b/rest/api/v3/subusers/model_sort_by_direction2.go new file mode 100644 index 00000000..cb54d9bf --- /dev/null +++ b/rest/api/v3/subusers/model_sort_by_direction2.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SortByDirection2 the model 'SortByDirection2' +type SortByDirection2 string + +// List of SortByDirection2 +const ( + SORTBYDIRECTION2_DESC SortByDirection2 = "desc" + SORTBYDIRECTION2_ASC SortByDirection2 = "asc" +) diff --git a/rest/api/v3/subusers/model_sort_by_metric.go b/rest/api/v3/subusers/model_sort_by_metric.go new file mode 100644 index 00000000..9a400ccb --- /dev/null +++ b/rest/api/v3/subusers/model_sort_by_metric.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SortByMetric the model 'SortByMetric' +type SortByMetric string + +// List of SortByMetric +const ( + SORTBYMETRIC_BLOCKS SortByMetric = "blocks" + SORTBYMETRIC_BOUNCES SortByMetric = "bounces" + SORTBYMETRIC_CLICKS SortByMetric = "clicks" + SORTBYMETRIC_DELIVERED SortByMetric = "delivered" + SORTBYMETRIC_OPENS SortByMetric = "opens" + SORTBYMETRIC_REQUESTS SortByMetric = "requests" + SORTBYMETRIC_UNIQUE_CLICKS SortByMetric = "unique_clicks" + SORTBYMETRIC_UNIQUE_OPENS SortByMetric = "unique_opens" + SORTBYMETRIC_UNSUBSCRIBES SortByMetric = "unsubscribes" +) diff --git a/rest/api/v3/subusers/model_subuser.go b/rest/api/v3/subusers/model_subuser.go new file mode 100644 index 00000000..a5128a1a --- /dev/null +++ b/rest/api/v3/subusers/model_subuser.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Subuser struct for Subuser +type Subuser struct { + // Whether or not the user is enabled or disabled. + Disabled bool `json:"disabled"` + // The ID of this subuser. + Id float32 `json:"id"` + // The name by which this subuser will be referred. + Username string `json:"username"` + // The email address to contact this subuser. + Email string `json:"email"` + // The region this Subuser is assigned to. This property is returned only if the `include_region` parameter was included and set to `true` in the API request. + Region *Region2 `json:"region,omitempty"` +} diff --git a/rest/api/v3/subusers/model_subuser_credits.go b/rest/api/v3/subusers/model_subuser_credits.go new file mode 100644 index 00000000..e3b6597d --- /dev/null +++ b/rest/api/v3/subusers/model_subuser_credits.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubuserCredits struct for SubuserCredits +type SubuserCredits struct { + // Type determines how credits are reset for a Subuser. `unlimited` indicates that there is no limit to the Subuser's credits. `recurring` indicates that the credits for the Subuser are reset according to the frequency determined by `reset_frequency`. `nonrecurring` indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis. + Type Type `json:"type"` + // The frequency with which a Subuser's credits are reset if `type` is set to `recurring`, otherwise `null`. + ResetFrequency ResetFrequency `json:"reset_frequency"` + // Total number of remaining credits. `remain` is `null` if the reset `type` for the Subuser's credits is set to `unlimited`. + Remain int32 `json:"remain"` + // Total number of allowable credits. `total` is `null` if the reset `type` for the Subuser's credits is set to `unlimited` or `nonrecurring`. + Total int32 `json:"total"` + // Total number of used credits. `used` is `null` if the reset `type` for the Subuser's credits is set to `unlimited` or `nonrecurring`. + Used int32 `json:"used"` +} diff --git a/rest/api/v3/subusers/model_subuser_credits_request.go b/rest/api/v3/subusers/model_subuser_credits_request.go new file mode 100644 index 00000000..4eadc773 --- /dev/null +++ b/rest/api/v3/subusers/model_subuser_credits_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubuserCreditsRequest struct for SubuserCreditsRequest +type SubuserCreditsRequest struct { + // Type determines how credits are reset for a Subuser. `unlimited` indicates that there is no limit to the Subuser's credits. `recurring` indicates that the credits for the Subuser are reset according to the frequency determined by `reset_frequency`. `nonrecurring` indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis. + Type Type1 `json:"type"` + // The frequency with which a Subuser's credits are reset if `type` is set to `recurring`. Do _not_ include `reset_frequency` if you choose a reset `type` value of `unlimited` or `nonrecurring`. + ResetFrequency *ResetFrequency1 `json:"reset_frequency,omitempty"` + // Total number of credits to which the Subuser is to be reset. If `type` is `nonrecurring` then the Subuser's credits will be reset to `total` on a one-time basis. If `type` is `recurring` then the Subuser's credits will be reset to `total` every time a reset is scheduled in accordance with the `reset_frequency`. Do _not_ include `total` if you choose a reset `type` value of `unlimited`. + Total *int32 `json:"total,omitempty"` +} diff --git a/rest/api/v3/subusers/model_subuser_post.go b/rest/api/v3/subusers/model_subuser_post.go new file mode 100644 index 00000000..f1a55390 --- /dev/null +++ b/rest/api/v3/subusers/model_subuser_post.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubuserPost struct for SubuserPost +type SubuserPost struct { + // The username of the subuser. + Username string `json:"username"` + // The user ID for this subuser. + UserId float32 `json:"user_id"` + // The email address for this subuser. + Email string `json:"email"` + CreditAllocation *SubuserPostCreditAllocation `json:"credit_allocation,omitempty"` + // The region this Subuser is assigned to. The property is returned only if the `include_region` parameter is included and set to `true` in the API request. + Region *Region3 `json:"region,omitempty"` +} diff --git a/rest/api/v3/subusers/model_subuser_post_credit_allocation.go b/rest/api/v3/subusers/model_subuser_post_credit_allocation.go new file mode 100644 index 00000000..6f6fb157 --- /dev/null +++ b/rest/api/v3/subusers/model_subuser_post_credit_allocation.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubuserPostCreditAllocation struct for SubuserPostCreditAllocation +type SubuserPostCreditAllocation struct { + Type *string `json:"type,omitempty"` +} diff --git a/rest/api/v3/subusers/model_subuser_stats.go b/rest/api/v3/subusers/model_subuser_stats.go new file mode 100644 index 00000000..3d1b6cd6 --- /dev/null +++ b/rest/api/v3/subusers/model_subuser_stats.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubuserStats struct for SubuserStats +type SubuserStats struct { + // The date the statistics were gathered. + Date *string `json:"date,omitempty"` + // The list of statistics. + Stats *[]SubuserStatsStatsInner `json:"stats,omitempty"` +} diff --git a/rest/api/v3/subusers/model_subuser_stats_stats_inner.go b/rest/api/v3/subusers/model_subuser_stats_stats_inner.go new file mode 100644 index 00000000..19e47dfd --- /dev/null +++ b/rest/api/v3/subusers/model_subuser_stats_stats_inner.go @@ -0,0 +1,27 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubuserStatsStatsInner struct for SubuserStatsStatsInner +type SubuserStatsStatsInner struct { + // The first name of the subuser. + FirstName *string `json:"first_name,omitempty"` + // The last name of the subuser. + LastName *string `json:"last_name,omitempty"` + Metrics *SubuserStatsStatsInnerMetrics `json:"metrics,omitempty"` + // The username of the subuser. + Name *string `json:"name,omitempty"` + // The type of account. + Type *string `json:"type,omitempty"` +} diff --git a/rest/api/v3/subusers/model_subuser_stats_stats_inner_metrics.go b/rest/api/v3/subusers/model_subuser_stats_stats_inner_metrics.go new file mode 100644 index 00000000..cd7afbe9 --- /dev/null +++ b/rest/api/v3/subusers/model_subuser_stats_stats_inner_metrics.go @@ -0,0 +1,50 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubuserStatsStatsInnerMetrics struct for SubuserStatsStatsInnerMetrics +type SubuserStatsStatsInnerMetrics struct { + // The number of emails that were not allowed to be delivered by ISPs. + Blocks *int32 `json:"blocks,omitempty"` + // The number of emails that were dropped because of a bounce. + BounceDrops *int32 `json:"bounce_drops,omitempty"` + // The number of emails that bounced instead of being delivered. + Bounces *int32 `json:"bounces,omitempty"` + // The number of links that were clicked in your emails. + Clicks *int32 `json:"clicks,omitempty"` + // The number of emails that temporarily could not be delivered. + Deferred *int32 `json:"deferred,omitempty"` + // The number of emails SendGrid was able to confirm were actually delivered to a recipient. + Delivered *int32 `json:"delivered,omitempty"` + // The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid. + InvalidEmails *int32 `json:"invalid_emails,omitempty"` + // The total number of times your emails were opened by recipients. + Opens *int32 `json:"opens,omitempty"` + // Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed. + Processed *int32 `json:"processed,omitempty"` + // The number of emails that were requested to be delivered. + Requests *int32 `json:"requests,omitempty"` + // The number of emails that were dropped due to a recipient previously marking your emails as spam. + SpamReportDrops *int32 `json:"spam_report_drops,omitempty"` + // The number of recipients who marked your email as spam. + SpamReports *int32 `json:"spam_reports,omitempty"` + // The number of unique recipients who clicked links in your emails. + UniqueClicks *int32 `json:"unique_clicks,omitempty"` + // The number of unique recipients who opened your emails. + UniqueOpens *int32 `json:"unique_opens,omitempty"` + // The number of emails dropped due to a recipient unsubscribing from your emails. + UnsubscribeDrops *int32 `json:"unsubscribe_drops,omitempty"` + // The number of recipients who unsubscribed from your emails. + Unsubscribes *int32 `json:"unsubscribes,omitempty"` +} diff --git a/rest/api/v3/subusers/model_type.go b/rest/api/v3/subusers/model_type.go new file mode 100644 index 00000000..c7460304 --- /dev/null +++ b/rest/api/v3/subusers/model_type.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_UNLIMITED Type = "unlimited" + TYPE_RECURRING Type = "recurring" + TYPE_NONRECURRING Type = "nonrecurring" +) diff --git a/rest/api/v3/subusers/model_type1.go b/rest/api/v3/subusers/model_type1.go new file mode 100644 index 00000000..0cdf19ad --- /dev/null +++ b/rest/api/v3/subusers/model_type1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type1 the model 'Type1' +type Type1 string + +// List of Type1 +const ( + TYPE1_UNLIMITED Type1 = "unlimited" + TYPE1_RECURRING Type1 = "recurring" + TYPE1_NONRECURRING Type1 = "nonrecurring" +) diff --git a/rest/api/v3/subusers/model_update_subuser_ip_200_response.go b/rest/api/v3/subusers/model_update_subuser_ip_200_response.go new file mode 100644 index 00000000..6f8d30ae --- /dev/null +++ b/rest/api/v3/subusers/model_update_subuser_ip_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSubuserIp200Response struct for UpdateSubuserIp200Response +type UpdateSubuserIp200Response struct { + // The IP addresses that are assigned to the subuser. + Ips *[]string `json:"ips,omitempty"` +} diff --git a/rest/api/v3/subusers/model_update_subuser_remaining_credit_request.go b/rest/api/v3/subusers/model_update_subuser_remaining_credit_request.go new file mode 100644 index 00000000..68f81f3c --- /dev/null +++ b/rest/api/v3/subusers/model_update_subuser_remaining_credit_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSubuserRemainingCreditRequest struct for UpdateSubuserRemainingCreditRequest +type UpdateSubuserRemainingCreditRequest struct { + // The number of credits to add to or subtract from the current remaining credits for the Subuser. Use a positive number to increase the remaining credits or a negative number to reduce the remaining credits. + AllocationUpdate int32 `json:"allocation_update"` +} diff --git a/rest/api/v3/subusers/model_update_subuser_request.go b/rest/api/v3/subusers/model_update_subuser_request.go new file mode 100644 index 00000000..c4bbc99a --- /dev/null +++ b/rest/api/v3/subusers/model_update_subuser_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSubuserRequest struct for UpdateSubuserRequest +type UpdateSubuserRequest struct { + // Whether or not this subuser is disabled. `true` means disabled, `false` means enabled. + Disabled *bool `json:"disabled,omitempty"` +} diff --git a/rest/api/v3/subusers/model_update_subuser_website_access_request.go b/rest/api/v3/subusers/model_update_subuser_website_access_request.go new file mode 100644 index 00000000..7af0aac6 --- /dev/null +++ b/rest/api/v3/subusers/model_update_subuser_website_access_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Subusers +* The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on [Pro and Premier plans](https://sendgrid.com/pricing), and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers. You can also manage Subusers in the [Twilio SendGrid application user interface](https://app.sendgrid.com/settings/subusers). See [**Subusers**](https://docs.sendgrid.com/ui/account-and-settings/subusers) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSubuserWebsiteAccessRequest struct for UpdateSubuserWebsiteAccessRequest +type UpdateSubuserWebsiteAccessRequest struct { + // Whether or not to disable website access to the Subuser. `true` means disabled, `false` means enabled. + Disabled *bool `json:"disabled,omitempty"` +} diff --git a/rest/api/v3/teammates/README.md b/rest/api/v3/teammates/README.md new file mode 100644 index 00000000..8fc932cd --- /dev/null +++ b/rest/api/v3/teammates/README.md @@ -0,0 +1,89 @@ +# Go API client for + +The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.490087+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DeletePendingTeammate* | [**DeletePendingTeammate**](docs/DeletePendingTeammate.md#deletependingteammate) | **Delete** /v3/teammates/pending/{Token} | Delete pending teammate +*DeleteTeammate* | [**DeleteTeammate**](docs/DeleteTeammate.md#deleteteammate) | **Delete** /v3/teammates/{Username} | Delete teammate +*GetTeammate* | [**GetTeammate**](docs/GetTeammate.md#getteammate) | **Get** /v3/teammates/{Username} | Retrieve specific teammate +*InviteTeammate* | [**InviteTeammate**](docs/InviteTeammate.md#inviteteammate) | **Post** /v3/teammates | Invite teammate +*ListPendingTeammate* | [**ListPendingTeammate**](docs/ListPendingTeammate.md#listpendingteammate) | **Get** /v3/teammates/pending | Retrieve all pending teammates +*ListSubuserByTemplate* | [**ListSubuserByTemplate**](docs/ListSubuserByTemplate.md#listsubuserbytemplate) | **Get** /v3/teammates/{TeammateName}/subuser_access | Get Teammate Subuser Access +*ListTeammate* | [**ListTeammate**](docs/ListTeammate.md#listteammate) | **Get** /v3/teammates | Retrieve all teammates +*ResendTeammateInvite* | [**ResendTeammateInvite**](docs/ResendTeammateInvite.md#resendteammateinvite) | **Post** /v3/teammates/pending/{Token}/resend | Resend teammate invite +*UpdateTeammate* | [**UpdateTeammate**](docs/UpdateTeammate.md#updateteammate) | **Patch** /v3/teammates/{Username} | Update teammate's permissions + + +## Documentation For Models + + - [GetTeammate200Response](GetTeammate200Response.md) + - [InviteTeammate201Response](InviteTeammate201Response.md) + - [InviteTeammate400Response](InviteTeammate400Response.md) + - [InviteTeammate400ResponseErrorsInner](InviteTeammate400ResponseErrorsInner.md) + - [InviteTeammateRequest](InviteTeammateRequest.md) + - [ListPendingTeammate200Response](ListPendingTeammate200Response.md) + - [ListPendingTeammate200ResponseResultInner](ListPendingTeammate200ResponseResultInner.md) + - [ListSubuserByTemplate200Response](ListSubuserByTemplate200Response.md) + - [ListSubuserByTemplate200ResponseMetadata](ListSubuserByTemplate200ResponseMetadata.md) + - [ListSubuserByTemplate200ResponseMetadataNextParams](ListSubuserByTemplate200ResponseMetadataNextParams.md) + - [ListSubuserByTemplate200ResponseSubuserAccessInner](ListSubuserByTemplate200ResponseSubuserAccessInner.md) + - [ListSubuserByTemplate400Response](ListSubuserByTemplate400Response.md) + - [ListSubuserByTemplate400ResponseErrorsInner](ListSubuserByTemplate400ResponseErrorsInner.md) + - [ListTeammate200Response](ListTeammate200Response.md) + - [ListTeammate200ResponseResultInner](ListTeammate200ResponseResultInner.md) + - [PermissionType](PermissionType.md) + - [ResendTeammateInvite200Response](ResendTeammateInvite200Response.md) + - [UpdateTeammate200Response](UpdateTeammate200Response.md) + - [UpdateTeammateRequest](UpdateTeammateRequest.md) + - [UserType](UserType.md) + - [UserType1](UserType1.md) + - [UserType2](UserType2.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/teammates/api_delete_pending_teammate.go b/rest/api/v3/teammates/api_delete_pending_teammate.go new file mode 100644 index 00000000..0bb4e0dd --- /dev/null +++ b/rest/api/v3/teammates/api_delete_pending_teammate.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeletePendingTeammateParam struct { + // The token for the invite you want to delete. + Token *string `json:"token"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeletePendingTeammateParam) SetToken(Token string) *DeletePendingTeammateParam { + params.Token = &Token + return params +} +func (params *DeletePendingTeammateParam) SetOnbehalfof(Onbehalfof string) *DeletePendingTeammateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a pending teammate invite.** +func (c *ApiService) DeletePendingTeammate(params *DeletePendingTeammateParam) (interface{}, error) { + path := "/v3/teammates/pending/{Token}" + if params != nil && params.Token != nil { + path = strings.Replace(path, "{"+"Token"+"}", *params.Token, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 404 { + ps := &InviteTeammate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_delete_teammate.go b/rest/api/v3/teammates/api_delete_teammate.go new file mode 100644 index 00000000..16e08595 --- /dev/null +++ b/rest/api/v3/teammates/api_delete_teammate.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteTeammateParam struct { + // The username of the teammate that you want to retrieve. + Username *string `json:"username"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteTeammateParam) SetUsername(Username string) *DeleteTeammateParam { + params.Username = &Username + return params +} +func (params *DeleteTeammateParam) SetOnbehalfof(Onbehalfof string) *DeleteTeammateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a teammate.** **Only the parent user or an admin teammate can delete another teammate.** +func (c *ApiService) DeleteTeammate(params *DeleteTeammateParam) (interface{}, error) { + path := "/v3/teammates/{Username}" + if params != nil && params.Username != nil { + path = strings.Replace(path, "{"+"Username"+"}", *params.Username, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 404 { + ps := &InviteTeammate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_get_teammate.go b/rest/api/v3/teammates/api_get_teammate.go new file mode 100644 index 00000000..c80fb7ae --- /dev/null +++ b/rest/api/v3/teammates/api_get_teammate.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetTeammateParam struct { + // The username of the teammate that you want to retrieve. + Username *string `json:"username"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetTeammateParam) SetUsername(Username string) *GetTeammateParam { + params.Username = &Username + return params +} +func (params *GetTeammateParam) SetOnbehalfof(Onbehalfof string) *GetTeammateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific Teammate by username.** You can retrieve the username's for each of your Teammates using the \"Retrieve all Teammates\" endpoint. +func (c *ApiService) GetTeammate(params *GetTeammateParam) (interface{}, error) { + path := "/v3/teammates/{Username}" + if params != nil && params.Username != nil { + path = strings.Replace(path, "{"+"Username"+"}", *params.Username, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetTeammate200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_invite_teammate.go b/rest/api/v3/teammates/api_invite_teammate.go new file mode 100644 index 00000000..90b19902 --- /dev/null +++ b/rest/api/v3/teammates/api_invite_teammate.go @@ -0,0 +1,82 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type InviteTeammateParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + InviteTeammateRequest *InviteTeammateRequest `json:"InviteTeammateRequest,omitempty"` +} + +func (params *InviteTeammateParam) SetOnbehalfof(Onbehalfof string) *InviteTeammateParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *InviteTeammateParam) SetInviteTeammateRequest(InviteTeammateRequest InviteTeammateRequest) *InviteTeammateParam { + params.InviteTeammateRequest = &InviteTeammateRequest + return params +} + +// **This endpoint allows you to invite a Teammate to your account via email.** You can set a Teammate's initial permissions using the `scopes` array in the request body. Teammate's will receive a minimum set of scopes from Twilio SendGrid that are necessary for the Teammate to function. **Note:** A teammate invite will expire after 7 days, but you may resend the invitation at any time to reset the expiration date. +func (c *ApiService) InviteTeammate(params *InviteTeammateParam) (interface{}, error) { + path := "/v3/teammates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.InviteTeammateRequest != nil { + b, err := json.Marshal(*params.InviteTeammateRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &InviteTeammate201Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &InviteTeammate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_list_pending_teammate.go b/rest/api/v3/teammates/api_list_pending_teammate.go new file mode 100644 index 00000000..2fefdcea --- /dev/null +++ b/rest/api/v3/teammates/api_list_pending_teammate.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListPendingTeammateParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListPendingTeammateParam) SetOnbehalfof(Onbehalfof string) *ListPendingTeammateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a list of all pending Teammate invitations.** Each teammate invitation is valid for 7 days. Users may resend the invitation to refresh the expiration date. +func (c *ApiService) ListPendingTeammate(params *ListPendingTeammateParam) (interface{}, error) { + path := "/v3/teammates/pending" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListPendingTeammate200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_list_subuser_by_template.go b/rest/api/v3/teammates/api_list_subuser_by_template.go new file mode 100644 index 00000000..fcd7c60f --- /dev/null +++ b/rest/api/v3/teammates/api_list_subuser_by_template.go @@ -0,0 +1,122 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" + + "strings" +) + +type ListSubuserByTemplateParam struct { + // The username of the Teammate for whom you want to retrieve Subuser access information. + TeammateName *string `json:"teammate_name"` + // The Subuser ID from which the API request will begin retrieving Subusers. This query parameter can be used in successive API calls to retrieve additional Subusers. + AfterSubuserId *int32 `json:"after_subuser_id,omitempty"` + // Limit the number of Subusers to be returned. The default `limit` is `100` per request. + Limit *int32 `json:"limit,omitempty"` + // A Subuser's username that will be used to filter the returned result. + Username *string `json:"username,omitempty"` +} + +func (params *ListSubuserByTemplateParam) SetTeammateName(TeammateName string) *ListSubuserByTemplateParam { + params.TeammateName = &TeammateName + return params +} +func (params *ListSubuserByTemplateParam) SetAfterSubuserId(AfterSubuserId int32) *ListSubuserByTemplateParam { + params.AfterSubuserId = &AfterSubuserId + return params +} +func (params *ListSubuserByTemplateParam) SetLimit(Limit int32) *ListSubuserByTemplateParam { + params.Limit = &Limit + return params +} +func (params *ListSubuserByTemplateParam) SetUsername(Username string) *ListSubuserByTemplateParam { + params.Username = &Username + return params +} + +// **This operation allows you to retrieve the Subusers that can be accessed by a specified Teammate.** This operation will return the Subusers available to a Teammate, including the scopes available. If the Teammate is an administrator, all Subusers will be returned. +func (c *ApiService) ListSubuserByTemplate(params *ListSubuserByTemplateParam) (interface{}, error) { + path := "/v3/teammates/{TeammateName}/subuser_access" + if params != nil && params.TeammateName != nil { + path = strings.Replace(path, "{"+"TeammateName"+"}", *params.TeammateName, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.AfterSubuserId != nil { + data.Set("after_subuser_id", fmt.Sprint(*params.AfterSubuserId)) + } + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Username != nil { + data.Set("username", *params.Username) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListSubuserByTemplate200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListSubuserByTemplate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ListSubuserByTemplate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ListSubuserByTemplate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 500 { + ps := &ListSubuserByTemplate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_list_teammate.go b/rest/api/v3/teammates/api_list_teammate.go new file mode 100644 index 00000000..32d03d2b --- /dev/null +++ b/rest/api/v3/teammates/api_list_teammate.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListTeammateParam struct { + // `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. The maximum page size for this endpoint is 500 items per page. + Limit *int32 `json:"limit,omitempty"` + // The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. + Offset *int32 `json:"offset,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListTeammateParam) SetLimit(Limit int32) *ListTeammateParam { + params.Limit = &Limit + return params +} +func (params *ListTeammateParam) SetOffset(Offset int32) *ListTeammateParam { + params.Offset = &Offset + return params +} +func (params *ListTeammateParam) SetOnbehalfof(Onbehalfof string) *ListTeammateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a paginated list of all current Teammates.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. +func (c *ApiService) ListTeammate(params *ListTeammateParam) (interface{}, error) { + path := "/v3/teammates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.Offset != nil { + data.Set("offset", fmt.Sprint(*params.Offset)) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListTeammate200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_resend_teammate_invite.go b/rest/api/v3/teammates/api_resend_teammate_invite.go new file mode 100644 index 00000000..fc8e2137 --- /dev/null +++ b/rest/api/v3/teammates/api_resend_teammate_invite.go @@ -0,0 +1,78 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ResendTeammateInviteParam struct { + // The token for the invite that you want to resend. + Token *string `json:"token"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ResendTeammateInviteParam) SetToken(Token string) *ResendTeammateInviteParam { + params.Token = &Token + return params +} +func (params *ResendTeammateInviteParam) SetOnbehalfof(Onbehalfof string) *ResendTeammateInviteParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to resend a Teammate invitation.** Teammate invitations will expire after 7 days. Resending an invitation will reset the expiration date. +func (c *ApiService) ResendTeammateInvite(params *ResendTeammateInviteParam) (interface{}, error) { + path := "/v3/teammates/pending/{Token}/resend" + if params != nil && params.Token != nil { + path = strings.Replace(path, "{"+"Token"+"}", *params.Token, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ResendTeammateInvite200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &InviteTeammate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/api_service.go b/rest/api/v3/teammates/api_service.go new file mode 100644 index 00000000..9ffc80f5 --- /dev/null +++ b/rest/api/v3/teammates/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/teammates/api_update_teammate.go b/rest/api/v3/teammates/api_update_teammate.go new file mode 100644 index 00000000..e3146553 --- /dev/null +++ b/rest/api/v3/teammates/api_update_teammate.go @@ -0,0 +1,101 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateTeammateParam struct { + // The username of the teammate that you want to retrieve. + Username *string `json:"username"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateTeammateRequest *UpdateTeammateRequest `json:"UpdateTeammateRequest,omitempty"` +} + +func (params *UpdateTeammateParam) SetUsername(Username string) *UpdateTeammateParam { + params.Username = &Username + return params +} +func (params *UpdateTeammateParam) SetOnbehalfof(Onbehalfof string) *UpdateTeammateParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateTeammateParam) SetUpdateTeammateRequest(UpdateTeammateRequest UpdateTeammateRequest) *UpdateTeammateParam { + params.UpdateTeammateRequest = &UpdateTeammateRequest + return params +} + +// **This endpoint allows you to update a teammate’s permissions.** To turn a teammate into an admin, the request body should contain an `is_admin` set to `true`. Otherwise, set `is_admin` to `false` and pass in all the scopes that a teammate should have. **Only the parent user or other admin teammates can update another teammate’s permissions.** **Admin users can only update permissions.** +func (c *ApiService) UpdateTeammate(params *UpdateTeammateParam) (interface{}, error) { + path := "/v3/teammates/{Username}" + if params != nil && params.Username != nil { + path = strings.Replace(path, "{"+"Username"+"}", *params.Username, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateTeammateRequest != nil { + b, err := json.Marshal(*params.UpdateTeammateRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateTeammate200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &InviteTeammate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &InviteTeammate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/teammates/docs/DeletePendingTeammate.md b/rest/api/v3/teammates/docs/DeletePendingTeammate.md new file mode 100644 index 00000000..c2dfe25e --- /dev/null +++ b/rest/api/v3/teammates/docs/DeletePendingTeammate.md @@ -0,0 +1,52 @@ +# DeletePendingTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeletePendingTeammate**](DeletePendingTeammate.md#DeletePendingTeammate) | **Delete** /v3/teammates/pending/{Token} | Delete pending teammate + + + +## DeletePendingTeammate + +> DeletePendingTeammate(ctx, Tokenoptional) + +Delete pending teammate + +**This endpoint allows you to delete a pending teammate invite.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Token** | **string** | The token for the invite you want to delete. + +### Other Parameters + +Other parameters are passed through a pointer to a DeletePendingTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/DeleteTeammate.md b/rest/api/v3/teammates/docs/DeleteTeammate.md new file mode 100644 index 00000000..49d1d4d4 --- /dev/null +++ b/rest/api/v3/teammates/docs/DeleteTeammate.md @@ -0,0 +1,52 @@ +# DeleteTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteTeammate**](DeleteTeammate.md#DeleteTeammate) | **Delete** /v3/teammates/{Username} | Delete teammate + + + +## DeleteTeammate + +> DeleteTeammate(ctx, Usernameoptional) + +Delete teammate + +**This endpoint allows you to delete a teammate.** **Only the parent user or an admin teammate can delete another teammate.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Username** | **string** | The username of the teammate that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/GetTeammate.md b/rest/api/v3/teammates/docs/GetTeammate.md new file mode 100644 index 00000000..9a3c21dd --- /dev/null +++ b/rest/api/v3/teammates/docs/GetTeammate.md @@ -0,0 +1,52 @@ +# GetTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetTeammate**](GetTeammate.md#GetTeammate) | **Get** /v3/teammates/{Username} | Retrieve specific teammate + + + +## GetTeammate + +> GetTeammate200Response GetTeammate(ctx, Usernameoptional) + +Retrieve specific teammate + +**This endpoint allows you to retrieve a specific Teammate by username.** You can retrieve the username's for each of your Teammates using the \"Retrieve all Teammates\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Username** | **string** | The username of the teammate that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GetTeammate200Response**](GetTeammate200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/GetTeammate200Response.md b/rest/api/v3/teammates/docs/GetTeammate200Response.md new file mode 100644 index 00000000..96209510 --- /dev/null +++ b/rest/api/v3/teammates/docs/GetTeammate200Response.md @@ -0,0 +1,25 @@ +# GetTeammate200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | Teammate's username |[optional] +**FirstName** | **string** | Teammate's first name |[optional] +**LastName** | **string** | Teammate's last name |[optional] +**Email** | **string** | Teammate's email |[optional] +**Scopes** | **[]interface{}** | Scopes associated to teammate |[optional] +**UserType** | [**UserType1**](UserType1.md) | Indicate the type of user: account owner, teammate admin user, or normal teammate |[optional] +**IsAdmin** | **bool** | Set to true if teammate has admin privileges |[optional] +**Phone** | **string** | (optional) Teammate's phone number |[optional] +**Website** | **string** | (optional) Teammate's website |[optional] +**Address** | **string** | (optional) Teammate's address |[optional] +**Address2** | **string** | (optional) Teammate's address |[optional] +**City** | **string** | (optional) Teammate's city |[optional] +**State** | **string** | (optional) Teammate's state |[optional] +**Zip** | **string** | (optional) Teammate's zip |[optional] +**Country** | **string** | (optional) Teammate's country |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/InviteTeammate.md b/rest/api/v3/teammates/docs/InviteTeammate.md new file mode 100644 index 00000000..c4041719 --- /dev/null +++ b/rest/api/v3/teammates/docs/InviteTeammate.md @@ -0,0 +1,49 @@ +# InviteTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**InviteTeammate**](InviteTeammate.md#InviteTeammate) | **Post** /v3/teammates | Invite teammate + + + +## InviteTeammate + +> InviteTeammate201Response InviteTeammate(ctx, optional) + +Invite teammate + +**This endpoint allows you to invite a Teammate to your account via email.** You can set a Teammate's initial permissions using the `scopes` array in the request body. Teammate's will receive a minimum set of scopes from Twilio SendGrid that are necessary for the Teammate to function. **Note:** A teammate invite will expire after 7 days, but you may resend the invitation at any time to reset the expiration date. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a InviteTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**InviteTeammateRequest** | [**InviteTeammateRequest**](InviteTeammateRequest.md) | + +### Return type + +[**InviteTeammate201Response**](InviteTeammate201Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/InviteTeammate201Response.md b/rest/api/v3/teammates/docs/InviteTeammate201Response.md new file mode 100644 index 00000000..63648c38 --- /dev/null +++ b/rest/api/v3/teammates/docs/InviteTeammate201Response.md @@ -0,0 +1,14 @@ +# InviteTeammate201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Token** | **string** | Token to identify invite |[optional] +**Email** | **string** | Teammate's email address |[optional] +**Scopes** | **[]interface{}** | Initial set of permissions to give to teammate if they accept the invite |[optional] +**IsAdmin** | **bool** | Set to true if teammate should have admin privileges |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/InviteTeammate400Response.md b/rest/api/v3/teammates/docs/InviteTeammate400Response.md new file mode 100644 index 00000000..7d0f0c73 --- /dev/null +++ b/rest/api/v3/teammates/docs/InviteTeammate400Response.md @@ -0,0 +1,11 @@ +# InviteTeammate400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]InviteTeammate400ResponseErrorsInner**](InviteTeammate400ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/InviteTeammate400ResponseErrorsInner.md b/rest/api/v3/teammates/docs/InviteTeammate400ResponseErrorsInner.md new file mode 100644 index 00000000..6bf97048 --- /dev/null +++ b/rest/api/v3/teammates/docs/InviteTeammate400ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# InviteTeammate400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**Field** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/InviteTeammateRequest.md b/rest/api/v3/teammates/docs/InviteTeammateRequest.md new file mode 100644 index 00000000..5d3912fd --- /dev/null +++ b/rest/api/v3/teammates/docs/InviteTeammateRequest.md @@ -0,0 +1,13 @@ +# InviteTeammateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | New teammate's email | +**Scopes** | **[]string** | Set to specify list of scopes that teammate should have. Should be empty if teammate is an admin. | +**IsAdmin** | **bool** | Set to true if teammate should be an admin user |[default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListPendingTeammate.md b/rest/api/v3/teammates/docs/ListPendingTeammate.md new file mode 100644 index 00000000..84312df6 --- /dev/null +++ b/rest/api/v3/teammates/docs/ListPendingTeammate.md @@ -0,0 +1,48 @@ +# ListPendingTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListPendingTeammate**](ListPendingTeammate.md#ListPendingTeammate) | **Get** /v3/teammates/pending | Retrieve all pending teammates + + + +## ListPendingTeammate + +> ListPendingTeammate200Response ListPendingTeammate(ctx, optional) + +Retrieve all pending teammates + +**This endpoint allows you to retrieve a list of all pending Teammate invitations.** Each teammate invitation is valid for 7 days. Users may resend the invitation to refresh the expiration date. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListPendingTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListPendingTeammate200Response**](ListPendingTeammate200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/ListPendingTeammate200Response.md b/rest/api/v3/teammates/docs/ListPendingTeammate200Response.md new file mode 100644 index 00000000..acaf8ee6 --- /dev/null +++ b/rest/api/v3/teammates/docs/ListPendingTeammate200Response.md @@ -0,0 +1,11 @@ +# ListPendingTeammate200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListPendingTeammate200ResponseResultInner**](ListPendingTeammate200ResponseResultInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListPendingTeammate200ResponseResultInner.md b/rest/api/v3/teammates/docs/ListPendingTeammate200ResponseResultInner.md new file mode 100644 index 00000000..e5ea2c9c --- /dev/null +++ b/rest/api/v3/teammates/docs/ListPendingTeammate200ResponseResultInner.md @@ -0,0 +1,15 @@ +# ListPendingTeammate200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | Email address teammate invite will be sent to |[optional] +**Scopes** | **[]string** | List of permissions to give teammate if they accept |[optional] +**IsAdmin** | **bool** | Set to true to indicate teammate should have the same set of permissions as parent user |[optional] +**Token** | **string** | Invitation token used to identify user |[optional] +**ExpirationDate** | **int32** | timestamp indicates when invite will expire. Expiration is 7 days after invite creation |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListSubuserByTemplate.md b/rest/api/v3/teammates/docs/ListSubuserByTemplate.md new file mode 100644 index 00000000..828e71ce --- /dev/null +++ b/rest/api/v3/teammates/docs/ListSubuserByTemplate.md @@ -0,0 +1,54 @@ +# ListSubuserByTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSubuserByTemplate**](ListSubuserByTemplate.md#ListSubuserByTemplate) | **Get** /v3/teammates/{TeammateName}/subuser_access | Get Teammate Subuser Access + + + +## ListSubuserByTemplate + +> ListSubuserByTemplate200Response ListSubuserByTemplate(ctx, TeammateNameoptional) + +Get Teammate Subuser Access + +**This operation allows you to retrieve the Subusers that can be accessed by a specified Teammate.** This operation will return the Subusers available to a Teammate, including the scopes available. If the Teammate is an administrator, all Subusers will be returned. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TeammateName** | **string** | The username of the Teammate for whom you want to retrieve Subuser access information. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSubuserByTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**AfterSubuserId** | **int32** | The Subuser ID from which the API request will begin retrieving Subusers. This query parameter can be used in successive API calls to retrieve additional Subusers. +**Limit** | **int32** | Limit the number of Subusers to be returned. The default `limit` is `100` per request. +**Username** | **string** | A Subuser's username that will be used to filter the returned result. + +### Return type + +[**ListSubuserByTemplate200Response**](ListSubuserByTemplate200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/ListSubuserByTemplate200Response.md b/rest/api/v3/teammates/docs/ListSubuserByTemplate200Response.md new file mode 100644 index 00000000..491b1817 --- /dev/null +++ b/rest/api/v3/teammates/docs/ListSubuserByTemplate200Response.md @@ -0,0 +1,13 @@ +# ListSubuserByTemplate200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasRestrictedSubuserAccess** | **bool** | When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. |[optional] +**SubuserAccess** | [**[]ListSubuserByTemplate200ResponseSubuserAccessInner**](ListSubuserByTemplate200ResponseSubuserAccessInner.md) | Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. |[optional] +**Metadata** | [**ListSubuserByTemplate200ResponseMetadata**](ListSubuserByTemplate200ResponseMetadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadata.md b/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadata.md new file mode 100644 index 00000000..ed90d06a --- /dev/null +++ b/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadata.md @@ -0,0 +1,11 @@ +# ListSubuserByTemplate200ResponseMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextParams** | [**ListSubuserByTemplate200ResponseMetadataNextParams**](ListSubuserByTemplate200ResponseMetadataNextParams.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadataNextParams.md b/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadataNextParams.md new file mode 100644 index 00000000..66b7c05d --- /dev/null +++ b/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseMetadataNextParams.md @@ -0,0 +1,13 @@ +# ListSubuserByTemplate200ResponseMetadataNextParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Limit** | **int32** | The limit specified in the `limit` query parameter to constrain the number of Subusers returned. |[optional] +**AfterSubuserId** | **int32** | The `after_subuser_id` property represents the last processed Subuser. If the `after_subuser_id` property is `null`, there are no more entries available. |[optional] +**Username** | **string** | The username of a Subuser passed in the `name` query parameter to filter results by username. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseSubuserAccessInner.md b/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseSubuserAccessInner.md new file mode 100644 index 00000000..2264a516 --- /dev/null +++ b/rest/api/v3/teammates/docs/ListSubuserByTemplate200ResponseSubuserAccessInner.md @@ -0,0 +1,16 @@ +# ListSubuserByTemplate200ResponseSubuserAccessInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | The ID of a Subuser to which the Teammate has access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). |[optional] +**Username** | **string** | The username of a Subuser to which the Teammate has access. |[optional] +**Email** | **string** | The email address of a Subuser to which the Teammate has access. |[optional] +**Disabled** | **bool** | Indicates if the Subuser is active for the SendGrid account. |[optional] +**PermissionType** | [**PermissionType**](PermissionType.md) | The level of access the Teammate has to the specified Subuser. This property value may be either `admin` or `restricted`. When is property is set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. |[optional] +**Scopes** | **[]string** | The permissions or scopes that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListSubuserByTemplate400Response.md b/rest/api/v3/teammates/docs/ListSubuserByTemplate400Response.md new file mode 100644 index 00000000..cce6bfd0 --- /dev/null +++ b/rest/api/v3/teammates/docs/ListSubuserByTemplate400Response.md @@ -0,0 +1,11 @@ +# ListSubuserByTemplate400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListSubuserByTemplate400ResponseErrorsInner**](ListSubuserByTemplate400ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListSubuserByTemplate400ResponseErrorsInner.md b/rest/api/v3/teammates/docs/ListSubuserByTemplate400ResponseErrorsInner.md new file mode 100644 index 00000000..e82f043b --- /dev/null +++ b/rest/api/v3/teammates/docs/ListSubuserByTemplate400ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# ListSubuserByTemplate400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | The message representing the error from the API. |[optional] +**Field** | **string** | The field associated with the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListTeammate.md b/rest/api/v3/teammates/docs/ListTeammate.md new file mode 100644 index 00000000..b2747274 --- /dev/null +++ b/rest/api/v3/teammates/docs/ListTeammate.md @@ -0,0 +1,50 @@ +# ListTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListTeammate**](ListTeammate.md#ListTeammate) | **Get** /v3/teammates | Retrieve all teammates + + + +## ListTeammate + +> ListTeammate200Response ListTeammate(ctx, optional) + +Retrieve all teammates + +**This endpoint allows you to retrieve a paginated list of all current Teammates.** You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **int32** | `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used. The maximum page size for this endpoint is 500 items per page. +**Offset** | **int32** | The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list. +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListTeammate200Response**](ListTeammate200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/ListTeammate200Response.md b/rest/api/v3/teammates/docs/ListTeammate200Response.md new file mode 100644 index 00000000..8bbca76d --- /dev/null +++ b/rest/api/v3/teammates/docs/ListTeammate200Response.md @@ -0,0 +1,11 @@ +# ListTeammate200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListTeammate200ResponseResultInner**](ListTeammate200ResponseResultInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ListTeammate200ResponseResultInner.md b/rest/api/v3/teammates/docs/ListTeammate200ResponseResultInner.md new file mode 100644 index 00000000..d7a2c068 --- /dev/null +++ b/rest/api/v3/teammates/docs/ListTeammate200ResponseResultInner.md @@ -0,0 +1,24 @@ +# ListTeammate200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | Teammate's username |[optional] +**Email** | **string** | Teammate's email |[optional] +**FirstName** | **string** | Teammate's first name |[optional] +**LastName** | **string** | Teammate's last name |[optional] +**UserType** | [**UserType**](UserType.md) | Indicate the type of user: owner user, teammate admin user, or normal teammate |[optional] +**IsAdmin** | **bool** | Set to true if teammate has admin privileges |[optional] +**Phone** | **string** | (optional) Teammate's phone number |[optional] +**Website** | **string** | (optional) Teammate's website |[optional] +**Address** | **string** | (optional) Teammate's address |[optional] +**Address2** | **string** | (optional) Teammate's address |[optional] +**City** | **string** | (optional) Teammate's city |[optional] +**State** | **string** | (optional) Teammate's state |[optional] +**Zip** | **string** | (optional) Teammate's zip |[optional] +**Country** | **string** | (optional) Teammate's country |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/PermissionType.md b/rest/api/v3/teammates/docs/PermissionType.md new file mode 100644 index 00000000..da44f853 --- /dev/null +++ b/rest/api/v3/teammates/docs/PermissionType.md @@ -0,0 +1,13 @@ +# PermissionType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**RESTRICTED** | string | (value: `"restricted"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/ResendTeammateInvite.md b/rest/api/v3/teammates/docs/ResendTeammateInvite.md new file mode 100644 index 00000000..24f8e42d --- /dev/null +++ b/rest/api/v3/teammates/docs/ResendTeammateInvite.md @@ -0,0 +1,52 @@ +# ResendTeammateInvite + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResendTeammateInvite**](ResendTeammateInvite.md#ResendTeammateInvite) | **Post** /v3/teammates/pending/{Token}/resend | Resend teammate invite + + + +## ResendTeammateInvite + +> ResendTeammateInvite200Response ResendTeammateInvite(ctx, Tokenoptional) + +Resend teammate invite + +**This endpoint allows you to resend a Teammate invitation.** Teammate invitations will expire after 7 days. Resending an invitation will reset the expiration date. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Token** | **string** | The token for the invite that you want to resend. + +### Other Parameters + +Other parameters are passed through a pointer to a ResendTeammateInviteParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ResendTeammateInvite200Response**](ResendTeammateInvite200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/ResendTeammateInvite200Response.md b/rest/api/v3/teammates/docs/ResendTeammateInvite200Response.md new file mode 100644 index 00000000..c203789a --- /dev/null +++ b/rest/api/v3/teammates/docs/ResendTeammateInvite200Response.md @@ -0,0 +1,14 @@ +# ResendTeammateInvite200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Token** | **string** | ID to identify invite |[optional] +**Email** | **string** | Teammate's email address |[optional] +**Scopes** | **[]string** | Initial set of permissions to give to teammate if they accept the invite |[optional] +**IsAdmin** | **bool** | Set to true if teammate should have admin privileges |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/UpdateTeammate.md b/rest/api/v3/teammates/docs/UpdateTeammate.md new file mode 100644 index 00000000..593e02cd --- /dev/null +++ b/rest/api/v3/teammates/docs/UpdateTeammate.md @@ -0,0 +1,53 @@ +# UpdateTeammate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateTeammate**](UpdateTeammate.md#UpdateTeammate) | **Patch** /v3/teammates/{Username} | Update teammate's permissions + + + +## UpdateTeammate + +> UpdateTeammate200Response UpdateTeammate(ctx, Usernameoptional) + +Update teammate's permissions + +**This endpoint allows you to update a teammate’s permissions.** To turn a teammate into an admin, the request body should contain an `is_admin` set to `true`. Otherwise, set `is_admin` to `false` and pass in all the scopes that a teammate should have. **Only the parent user or other admin teammates can update another teammate’s permissions.** **Admin users can only update permissions.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Username** | **string** | The username of the teammate that you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateTeammateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateTeammateRequest** | [**UpdateTeammateRequest**](UpdateTeammateRequest.md) | + +### Return type + +[**UpdateTeammate200Response**](UpdateTeammate200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/teammates/docs/UpdateTeammate200Response.md b/rest/api/v3/teammates/docs/UpdateTeammate200Response.md new file mode 100644 index 00000000..65414c2e --- /dev/null +++ b/rest/api/v3/teammates/docs/UpdateTeammate200Response.md @@ -0,0 +1,25 @@ +# UpdateTeammate200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | Teammate's username |[optional] +**FirstName** | **string** | Teammate's first name |[optional] +**LastName** | **string** | Teammate's last name |[optional] +**Email** | **string** | Teammate's email address |[optional] +**Scopes** | **[]string** | Scopes given to teammate |[optional] +**UserType** | [**UserType2**](UserType2.md) | Indicate the type of user: owner user, teammate admin user, or normal teammate |[optional] +**IsAdmin** | **bool** | Set to true if teammate has admin priveleges |[optional] +**Phone** | **string** | (optional) Teammate's phone number |[optional] +**Website** | **string** | (optional) Teammate's website |[optional] +**Address** | **string** | (optional) Teammate's address |[optional] +**Address2** | **string** | (optional) Teammate's address |[optional] +**City** | **string** | (optional) Teammate's city |[optional] +**State** | **string** | (optional) Teammate's state |[optional] +**Zip** | **string** | (optional) Teammate's zip |[optional] +**Country** | **string** | (optional) Teammate's country |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/UpdateTeammateRequest.md b/rest/api/v3/teammates/docs/UpdateTeammateRequest.md new file mode 100644 index 00000000..ca9956e0 --- /dev/null +++ b/rest/api/v3/teammates/docs/UpdateTeammateRequest.md @@ -0,0 +1,12 @@ +# UpdateTeammateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Scopes** | **[]string** | Provide list of scopes that should be given to teammate. If specifying list of scopes, is_admin should be set to False. | +**IsAdmin** | **bool** | Set to True if this teammate should be promoted to an admin user. If True, scopes should be an empty array. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/UserType.md b/rest/api/v3/teammates/docs/UserType.md new file mode 100644 index 00000000..f9f8db1d --- /dev/null +++ b/rest/api/v3/teammates/docs/UserType.md @@ -0,0 +1,14 @@ +# UserType + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**OWNER** | string | (value: `"owner"`) +**TEAMMATE** | string | (value: `"teammate"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/UserType1.md b/rest/api/v3/teammates/docs/UserType1.md new file mode 100644 index 00000000..008e09e1 --- /dev/null +++ b/rest/api/v3/teammates/docs/UserType1.md @@ -0,0 +1,14 @@ +# UserType1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**OWNER** | string | (value: `"owner"`) +**TEAMMATE** | string | (value: `"teammate"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/docs/UserType2.md b/rest/api/v3/teammates/docs/UserType2.md new file mode 100644 index 00000000..59679096 --- /dev/null +++ b/rest/api/v3/teammates/docs/UserType2.md @@ -0,0 +1,14 @@ +# UserType2 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**ADMIN** | string | (value: `"admin"`) +**OWNER** | string | (value: `"owner"`) +**TEAMMATE** | string | (value: `"teammate"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/teammates/model_get_teammate_200_response.go b/rest/api/v3/teammates/model_get_teammate_200_response.go new file mode 100644 index 00000000..a1c30f71 --- /dev/null +++ b/rest/api/v3/teammates/model_get_teammate_200_response.go @@ -0,0 +1,48 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetTeammate200Response struct for GetTeammate200Response +type GetTeammate200Response struct { + // Teammate's username + Username *string `json:"username,omitempty"` + // Teammate's first name + FirstName *string `json:"first_name,omitempty"` + // Teammate's last name + LastName *string `json:"last_name,omitempty"` + // Teammate's email + Email *string `json:"email,omitempty"` + // Scopes associated to teammate + Scopes *[]interface{} `json:"scopes,omitempty"` + // Indicate the type of user: account owner, teammate admin user, or normal teammate + UserType *UserType1 `json:"user_type,omitempty"` + // Set to true if teammate has admin privileges + IsAdmin *bool `json:"is_admin,omitempty"` + // (optional) Teammate's phone number + Phone *string `json:"phone,omitempty"` + // (optional) Teammate's website + Website *string `json:"website,omitempty"` + // (optional) Teammate's address + Address *string `json:"address,omitempty"` + // (optional) Teammate's address + Address2 *string `json:"address2,omitempty"` + // (optional) Teammate's city + City *string `json:"city,omitempty"` + // (optional) Teammate's state + State *string `json:"state,omitempty"` + // (optional) Teammate's zip + Zip *string `json:"zip,omitempty"` + // (optional) Teammate's country + Country *string `json:"country,omitempty"` +} diff --git a/rest/api/v3/teammates/model_invite_teammate_201_response.go b/rest/api/v3/teammates/model_invite_teammate_201_response.go new file mode 100644 index 00000000..ae183bf4 --- /dev/null +++ b/rest/api/v3/teammates/model_invite_teammate_201_response.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// InviteTeammate201Response struct for InviteTeammate201Response +type InviteTeammate201Response struct { + // Token to identify invite + Token *string `json:"token,omitempty"` + // Teammate's email address + Email *string `json:"email,omitempty"` + // Initial set of permissions to give to teammate if they accept the invite + Scopes *[]interface{} `json:"scopes,omitempty"` + // Set to true if teammate should have admin privileges + IsAdmin *bool `json:"is_admin,omitempty"` +} diff --git a/rest/api/v3/teammates/model_invite_teammate_400_response.go b/rest/api/v3/teammates/model_invite_teammate_400_response.go new file mode 100644 index 00000000..f3bd0fd1 --- /dev/null +++ b/rest/api/v3/teammates/model_invite_teammate_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// InviteTeammate400Response struct for InviteTeammate400Response +type InviteTeammate400Response struct { + Errors *[]InviteTeammate400ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/teammates/model_invite_teammate_400_response_errors_inner.go b/rest/api/v3/teammates/model_invite_teammate_400_response_errors_inner.go new file mode 100644 index 00000000..e21587e5 --- /dev/null +++ b/rest/api/v3/teammates/model_invite_teammate_400_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// InviteTeammate400ResponseErrorsInner struct for InviteTeammate400ResponseErrorsInner +type InviteTeammate400ResponseErrorsInner struct { + Message *string `json:"message,omitempty"` + Field *string `json:"field,omitempty"` +} diff --git a/rest/api/v3/teammates/model_invite_teammate_request.go b/rest/api/v3/teammates/model_invite_teammate_request.go new file mode 100644 index 00000000..ee0342cd --- /dev/null +++ b/rest/api/v3/teammates/model_invite_teammate_request.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// InviteTeammateRequest struct for InviteTeammateRequest +type InviteTeammateRequest struct { + // New teammate's email + Email string `json:"email"` + // Set to specify list of scopes that teammate should have. Should be empty if teammate is an admin. + Scopes []string `json:"scopes"` + // Set to true if teammate should be an admin user + IsAdmin bool `json:"is_admin"` +} diff --git a/rest/api/v3/teammates/model_list_pending_teammate_200_response.go b/rest/api/v3/teammates/model_list_pending_teammate_200_response.go new file mode 100644 index 00000000..e23aa0d5 --- /dev/null +++ b/rest/api/v3/teammates/model_list_pending_teammate_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListPendingTeammate200Response struct for ListPendingTeammate200Response +type ListPendingTeammate200Response struct { + Result *[]ListPendingTeammate200ResponseResultInner `json:"result,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_pending_teammate_200_response_result_inner.go b/rest/api/v3/teammates/model_list_pending_teammate_200_response_result_inner.go new file mode 100644 index 00000000..2ec83181 --- /dev/null +++ b/rest/api/v3/teammates/model_list_pending_teammate_200_response_result_inner.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListPendingTeammate200ResponseResultInner struct for ListPendingTeammate200ResponseResultInner +type ListPendingTeammate200ResponseResultInner struct { + // Email address teammate invite will be sent to + Email *string `json:"email,omitempty"` + // List of permissions to give teammate if they accept + Scopes *[]string `json:"scopes,omitempty"` + // Set to true to indicate teammate should have the same set of permissions as parent user + IsAdmin *bool `json:"is_admin,omitempty"` + // Invitation token used to identify user + Token *string `json:"token,omitempty"` + // timestamp indicates when invite will expire. Expiration is 7 days after invite creation + ExpirationDate *int32 `json:"expiration_date,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_subuser_by_template_200_response.go b/rest/api/v3/teammates/model_list_subuser_by_template_200_response.go new file mode 100644 index 00000000..6b55158e --- /dev/null +++ b/rest/api/v3/teammates/model_list_subuser_by_template_200_response.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubuserByTemplate200Response struct for ListSubuserByTemplate200Response +type ListSubuserByTemplate200Response struct { + // When this property is set to `true`, the Teammate has permissions to operate only on behalf of a Subuser. This property value is `true` when the `subuser_access` property is not empty. The `subuser_access` property determines which Subusers the Teammate may act on behalf of. + HasRestrictedSubuserAccess *bool `json:"has_restricted_subuser_access,omitempty"` + // Specifies which Subusers the Teammate may access and act on behalf of. If this property is populated, the `has_restricted_subuser_access` property will be `true`. + SubuserAccess *[]ListSubuserByTemplate200ResponseSubuserAccessInner `json:"subuser_access,omitempty"` + Metadata *ListSubuserByTemplate200ResponseMetadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata.go b/rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata.go new file mode 100644 index 00000000..4c207d5e --- /dev/null +++ b/rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubuserByTemplate200ResponseMetadata This object contains response metadata. The presence of the `after_subuser_id` property in the metadata indicates that some items are still outstanding and have not been retrieved. You can use the `after_subuser_id` value to retrieve additional items with another request. +type ListSubuserByTemplate200ResponseMetadata struct { + NextParams *ListSubuserByTemplate200ResponseMetadataNextParams `json:"next_params,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata_next_params.go b/rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata_next_params.go new file mode 100644 index 00000000..c28bf633 --- /dev/null +++ b/rest/api/v3/teammates/model_list_subuser_by_template_200_response__metadata_next_params.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubuserByTemplate200ResponseMetadataNextParams struct for ListSubuserByTemplate200ResponseMetadataNextParams +type ListSubuserByTemplate200ResponseMetadataNextParams struct { + // The limit specified in the `limit` query parameter to constrain the number of Subusers returned. + Limit *int32 `json:"limit,omitempty"` + // The `after_subuser_id` property represents the last processed Subuser. If the `after_subuser_id` property is `null`, there are no more entries available. + AfterSubuserId *int32 `json:"after_subuser_id,omitempty"` + // The username of a Subuser passed in the `name` query parameter to filter results by username. + Username *string `json:"username,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_subuser_by_template_200_response_subuser_access_inner.go b/rest/api/v3/teammates/model_list_subuser_by_template_200_response_subuser_access_inner.go new file mode 100644 index 00000000..100906bb --- /dev/null +++ b/rest/api/v3/teammates/model_list_subuser_by_template_200_response_subuser_access_inner.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubuserByTemplate200ResponseSubuserAccessInner An array of Subusers to which the Teammate has access. +type ListSubuserByTemplate200ResponseSubuserAccessInner struct { + // The ID of a Subuser to which the Teammate has access. You can retrieve Subuser IDs from the [Subusers API](https://docs.sendgrid.com/api-reference/subusers-api/). + Id *int32 `json:"id,omitempty"` + // The username of a Subuser to which the Teammate has access. + Username *string `json:"username,omitempty"` + // The email address of a Subuser to which the Teammate has access. + Email *string `json:"email,omitempty"` + // Indicates if the Subuser is active for the SendGrid account. + Disabled *bool `json:"disabled,omitempty"` + // The level of access the Teammate has to the specified Subuser. This property value may be either `admin` or `restricted`. When is property is set to `restricted`, the Teammate has only the permissions assigned in the `scopes` property. + PermissionType *PermissionType `json:"permission_type,omitempty"` + // The permissions or scopes that the Teammate can access on behalf of the Subuser. See [**Teammate Permissions**](https://docs.sendgrid.com/ui/account-and-settings/teammate-permissions) for a complete list of available scopes. + Scopes *[]string `json:"scopes,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_subuser_by_template_400_response.go b/rest/api/v3/teammates/model_list_subuser_by_template_400_response.go new file mode 100644 index 00000000..a404698d --- /dev/null +++ b/rest/api/v3/teammates/model_list_subuser_by_template_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubuserByTemplate400Response An object containing an array of errors objects. +type ListSubuserByTemplate400Response struct { + Errors *[]ListSubuserByTemplate400ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_subuser_by_template_400_response_errors_inner.go b/rest/api/v3/teammates/model_list_subuser_by_template_400_response_errors_inner.go new file mode 100644 index 00000000..8a442ec9 --- /dev/null +++ b/rest/api/v3/teammates/model_list_subuser_by_template_400_response_errors_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListSubuserByTemplate400ResponseErrorsInner struct for ListSubuserByTemplate400ResponseErrorsInner +type ListSubuserByTemplate400ResponseErrorsInner struct { + // The message representing the error from the API. + Message *string `json:"message,omitempty"` + // The field associated with the error. + Field *string `json:"field,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_teammate_200_response.go b/rest/api/v3/teammates/model_list_teammate_200_response.go new file mode 100644 index 00000000..09609911 --- /dev/null +++ b/rest/api/v3/teammates/model_list_teammate_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListTeammate200Response struct for ListTeammate200Response +type ListTeammate200Response struct { + Result *[]ListTeammate200ResponseResultInner `json:"result,omitempty"` +} diff --git a/rest/api/v3/teammates/model_list_teammate_200_response_result_inner.go b/rest/api/v3/teammates/model_list_teammate_200_response_result_inner.go new file mode 100644 index 00000000..c0a8d40c --- /dev/null +++ b/rest/api/v3/teammates/model_list_teammate_200_response_result_inner.go @@ -0,0 +1,46 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListTeammate200ResponseResultInner struct for ListTeammate200ResponseResultInner +type ListTeammate200ResponseResultInner struct { + // Teammate's username + Username *string `json:"username,omitempty"` + // Teammate's email + Email *string `json:"email,omitempty"` + // Teammate's first name + FirstName *string `json:"first_name,omitempty"` + // Teammate's last name + LastName *string `json:"last_name,omitempty"` + // Indicate the type of user: owner user, teammate admin user, or normal teammate + UserType *UserType `json:"user_type,omitempty"` + // Set to true if teammate has admin privileges + IsAdmin *bool `json:"is_admin,omitempty"` + // (optional) Teammate's phone number + Phone *string `json:"phone,omitempty"` + // (optional) Teammate's website + Website *string `json:"website,omitempty"` + // (optional) Teammate's address + Address *string `json:"address,omitempty"` + // (optional) Teammate's address + Address2 *string `json:"address2,omitempty"` + // (optional) Teammate's city + City *string `json:"city,omitempty"` + // (optional) Teammate's state + State *string `json:"state,omitempty"` + // (optional) Teammate's zip + Zip *string `json:"zip,omitempty"` + // (optional) Teammate's country + Country *string `json:"country,omitempty"` +} diff --git a/rest/api/v3/teammates/model_permission_type.go b/rest/api/v3/teammates/model_permission_type.go new file mode 100644 index 00000000..b581984f --- /dev/null +++ b/rest/api/v3/teammates/model_permission_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// PermissionType the model 'PermissionType' +type PermissionType string + +// List of PermissionType +const ( + PERMISSIONTYPE_ADMIN PermissionType = "admin" + PERMISSIONTYPE_RESTRICTED PermissionType = "restricted" +) diff --git a/rest/api/v3/teammates/model_resend_teammate_invite_200_response.go b/rest/api/v3/teammates/model_resend_teammate_invite_200_response.go new file mode 100644 index 00000000..a229bfa2 --- /dev/null +++ b/rest/api/v3/teammates/model_resend_teammate_invite_200_response.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ResendTeammateInvite200Response struct for ResendTeammateInvite200Response +type ResendTeammateInvite200Response struct { + // ID to identify invite + Token *string `json:"token,omitempty"` + // Teammate's email address + Email *string `json:"email,omitempty"` + // Initial set of permissions to give to teammate if they accept the invite + Scopes *[]string `json:"scopes,omitempty"` + // Set to true if teammate should have admin privileges + IsAdmin *bool `json:"is_admin,omitempty"` +} diff --git a/rest/api/v3/teammates/model_update_teammate_200_response.go b/rest/api/v3/teammates/model_update_teammate_200_response.go new file mode 100644 index 00000000..37332bfe --- /dev/null +++ b/rest/api/v3/teammates/model_update_teammate_200_response.go @@ -0,0 +1,48 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateTeammate200Response struct for UpdateTeammate200Response +type UpdateTeammate200Response struct { + // Teammate's username + Username *string `json:"username,omitempty"` + // Teammate's first name + FirstName *string `json:"first_name,omitempty"` + // Teammate's last name + LastName *string `json:"last_name,omitempty"` + // Teammate's email address + Email *string `json:"email,omitempty"` + // Scopes given to teammate + Scopes *[]string `json:"scopes,omitempty"` + // Indicate the type of user: owner user, teammate admin user, or normal teammate + UserType *UserType2 `json:"user_type,omitempty"` + // Set to true if teammate has admin priveleges + IsAdmin *bool `json:"is_admin,omitempty"` + // (optional) Teammate's phone number + Phone *string `json:"phone,omitempty"` + // (optional) Teammate's website + Website *string `json:"website,omitempty"` + // (optional) Teammate's address + Address *string `json:"address,omitempty"` + // (optional) Teammate's address + Address2 *string `json:"address2,omitempty"` + // (optional) Teammate's city + City *string `json:"city,omitempty"` + // (optional) Teammate's state + State *string `json:"state,omitempty"` + // (optional) Teammate's zip + Zip *string `json:"zip,omitempty"` + // (optional) Teammate's country + Country *string `json:"country,omitempty"` +} diff --git a/rest/api/v3/teammates/model_update_teammate_request.go b/rest/api/v3/teammates/model_update_teammate_request.go new file mode 100644 index 00000000..a7869ed0 --- /dev/null +++ b/rest/api/v3/teammates/model_update_teammate_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateTeammateRequest struct for UpdateTeammateRequest +type UpdateTeammateRequest struct { + // Provide list of scopes that should be given to teammate. If specifying list of scopes, is_admin should be set to False. + Scopes []string `json:"scopes"` + // Set to True if this teammate should be promoted to an admin user. If True, scopes should be an empty array. + IsAdmin bool `json:"is_admin"` +} diff --git a/rest/api/v3/teammates/model_user_type.go b/rest/api/v3/teammates/model_user_type.go new file mode 100644 index 00000000..ca06b801 --- /dev/null +++ b/rest/api/v3/teammates/model_user_type.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UserType the model 'UserType' +type UserType string + +// List of UserType +const ( + USERTYPE_ADMIN UserType = "admin" + USERTYPE_OWNER UserType = "owner" + USERTYPE_TEAMMATE UserType = "teammate" +) diff --git a/rest/api/v3/teammates/model_user_type1.go b/rest/api/v3/teammates/model_user_type1.go new file mode 100644 index 00000000..133a3591 --- /dev/null +++ b/rest/api/v3/teammates/model_user_type1.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UserType1 the model 'UserType1' +type UserType1 string + +// List of UserType1 +const ( + USERTYPE1_ADMIN UserType1 = "admin" + USERTYPE1_OWNER UserType1 = "owner" + USERTYPE1_TEAMMATE UserType1 = "teammate" +) diff --git a/rest/api/v3/teammates/model_user_type2.go b/rest/api/v3/teammates/model_user_type2.go new file mode 100644 index 00000000..4dcb15df --- /dev/null +++ b/rest/api/v3/teammates/model_user_type2.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Teammates API +* The Twilio SendGrid Teammates API allows you to add, manage, and remove Teammates, or user accounts, from your SendGrid account. Teammates function like user accounts on the SendGrid account, allowing you to invite additional users to your account with scoped access. You can think of Teammates as SendGrid's approach to enabling [role-based access control](https://en.wikipedia.org/wiki/Role-based_access_control) for your SendGrid account. For even more control over the access to your account, see the [Twilio SendGrid SSO API](https://docs.sendgrid.com/api-reference/single-sign-on-teammates/), which enables SSO-authenticated Teammates to be managed through a SAML 2.0 identity provider. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UserType2 the model 'UserType2' +type UserType2 string + +// List of UserType2 +const ( + USERTYPE2_ADMIN UserType2 = "admin" + USERTYPE2_OWNER UserType2 = "owner" + USERTYPE2_TEAMMATE UserType2 = "teammate" +) diff --git a/rest/api/v3/templates/README.md b/rest/api/v3/templates/README.md new file mode 100644 index 00000000..a3219329 --- /dev/null +++ b/rest/api/v3/templates/README.md @@ -0,0 +1,93 @@ +# Go API client for + +The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. + +This API provides operations to create and manage your templates as well as their versions. + +Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.479210+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ActivateTemplateVersion* | [**ActivateTemplateVersion**](docs/ActivateTemplateVersion.md#activatetemplateversion) | **Post** /v3/templates/{TemplateId}/versions/{VersionId}/activate | Activate a transactional template version. +*CreateTemplate* | [**CreateTemplate**](docs/CreateTemplate.md#createtemplate) | **Post** /v3/templates | Create a transactional template. +*CreateTemplateVersion* | [**CreateTemplateVersion**](docs/CreateTemplateVersion.md#createtemplateversion) | **Post** /v3/templates/{TemplateId}/versions | Create a new transactional template version. +*DeleteTemplate* | [**DeleteTemplate**](docs/DeleteTemplate.md#deletetemplate) | **Delete** /v3/templates/{TemplateId} | Delete a template. +*DeleteTemplateVersion* | [**DeleteTemplateVersion**](docs/DeleteTemplateVersion.md#deletetemplateversion) | **Delete** /v3/templates/{TemplateId}/versions/{VersionId} | Delete a transactional template version. +*DuplicateTemplate* | [**DuplicateTemplate**](docs/DuplicateTemplate.md#duplicatetemplate) | **Post** /v3/templates/{TemplateId} | Duplicate a transactional template. +*GetTemplate* | [**GetTemplate**](docs/GetTemplate.md#gettemplate) | **Get** /v3/templates/{TemplateId} | Retrieve a single transactional template. +*GetTemplateVersion* | [**GetTemplateVersion**](docs/GetTemplateVersion.md#gettemplateversion) | **Get** /v3/templates/{TemplateId}/versions/{VersionId} | Retrieve a specific transactional template version. +*ListTemplate* | [**ListTemplate**](docs/ListTemplate.md#listtemplate) | **Get** /v3/templates | Retrieve paged transactional templates. +*UpdateTemplate* | [**UpdateTemplate**](docs/UpdateTemplate.md#updatetemplate) | **Patch** /v3/templates/{TemplateId} | Edit a transactional template. +*UpdateTemplateVersion* | [**UpdateTemplateVersion**](docs/UpdateTemplateVersion.md#updatetemplateversion) | **Patch** /v3/templates/{TemplateId}/versions/{VersionId} | Edit a transactional template version. + + +## Documentation For Models + + - [Active](Active.md) + - [Active1](Active1.md) + - [CreateTemplateRequest](CreateTemplateRequest.md) + - [DuplicateTemplateRequest](DuplicateTemplateRequest.md) + - [Editor](Editor.md) + - [Editor1](Editor1.md) + - [Generation](Generation.md) + - [Generation1](Generation1.md) + - [Generations](Generations.md) + - [ListTemplate200Response](ListTemplate200Response.md) + - [ListTemplate400Response](ListTemplate400Response.md) + - [ListTemplate400ResponseErrorsInner](ListTemplate400ResponseErrorsInner.md) + - [Metadata](Metadata.md) + - [TransactionalTemplate](TransactionalTemplate.md) + - [TransactionalTemplateVersionCreate](TransactionalTemplateVersionCreate.md) + - [TransactionalTemplateVersionOutput](TransactionalTemplateVersionOutput.md) + - [TransactionalTemplateWarning](TransactionalTemplateWarning.md) + - [TransactionalTemplatesTemplateLean](TransactionalTemplatesTemplateLean.md) + - [TransactionalTemplatesVersionOutputLean](TransactionalTemplatesVersionOutputLean.md) + - [UpdateTemplateRequest](UpdateTemplateRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/templates/api_activate_template_version.go b/rest/api/v3/templates/api_activate_template_version.go new file mode 100644 index 00000000..440b1ae8 --- /dev/null +++ b/rest/api/v3/templates/api_activate_template_version.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ActivateTemplateVersionParam struct { + // The ID of the original template + TemplateId *string `json:"template_id"` + // The ID of the template version + VersionId *string `json:"version_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ActivateTemplateVersionParam) SetTemplateId(TemplateId string) *ActivateTemplateVersionParam { + params.TemplateId = &TemplateId + return params +} +func (params *ActivateTemplateVersionParam) SetVersionId(VersionId string) *ActivateTemplateVersionParam { + params.VersionId = &VersionId + return params +} +func (params *ActivateTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *ActivateTemplateVersionParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to activate a version of one of your templates.** +func (c *ApiService) ActivateTemplateVersion(params *ActivateTemplateVersionParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}/versions/{VersionId}/activate" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + if params != nil && params.VersionId != nil { + path = strings.Replace(path, "{"+"VersionId"+"}", *params.VersionId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &TransactionalTemplateVersionOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_create_template.go b/rest/api/v3/templates/api_create_template.go new file mode 100644 index 00000000..1e8f6a53 --- /dev/null +++ b/rest/api/v3/templates/api_create_template.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateTemplateParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + CreateTemplateRequest *CreateTemplateRequest `json:"CreateTemplateRequest,omitempty"` +} + +func (params *CreateTemplateParam) SetOnbehalfof(Onbehalfof string) *CreateTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateTemplateParam) SetCreateTemplateRequest(CreateTemplateRequest CreateTemplateRequest) *CreateTemplateParam { + params.CreateTemplateRequest = &CreateTemplateRequest + return params +} + +// **This endpoint allows you to create a transactional template.** +func (c *ApiService) CreateTemplate(params *CreateTemplateParam) (interface{}, error) { + path := "/v3/templates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.CreateTemplateRequest != nil { + b, err := json.Marshal(*params.CreateTemplateRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &TransactionalTemplate{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_create_template_version.go b/rest/api/v3/templates/api_create_template_version.go new file mode 100644 index 00000000..a4fad70e --- /dev/null +++ b/rest/api/v3/templates/api_create_template_version.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type CreateTemplateVersionParam struct { + // + TemplateId *string `json:"template_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + TransactionalTemplateVersionCreate *TransactionalTemplateVersionCreate `json:"TransactionalTemplateVersionCreate,omitempty"` +} + +func (params *CreateTemplateVersionParam) SetTemplateId(TemplateId string) *CreateTemplateVersionParam { + params.TemplateId = &TemplateId + return params +} +func (params *CreateTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *CreateTemplateVersionParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateTemplateVersionParam) SetTransactionalTemplateVersionCreate(TransactionalTemplateVersionCreate TransactionalTemplateVersionCreate) *CreateTemplateVersionParam { + params.TransactionalTemplateVersionCreate = &TransactionalTemplateVersionCreate + return params +} + +// **This endpoint allows you to create a new version of a template.** +func (c *ApiService) CreateTemplateVersion(params *CreateTemplateVersionParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}/versions" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.TransactionalTemplateVersionCreate != nil { + b, err := json.Marshal(*params.TransactionalTemplateVersionCreate) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &TransactionalTemplateVersionOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_delete_template.go b/rest/api/v3/templates/api_delete_template.go new file mode 100644 index 00000000..18dfb477 --- /dev/null +++ b/rest/api/v3/templates/api_delete_template.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteTemplateParam struct { + // + TemplateId *string `json:"template_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteTemplateParam) SetTemplateId(TemplateId string) *DeleteTemplateParam { + params.TemplateId = &TemplateId + return params +} +func (params *DeleteTemplateParam) SetOnbehalfof(Onbehalfof string) *DeleteTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a transactional template.** +func (c *ApiService) DeleteTemplate(params *DeleteTemplateParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_delete_template_version.go b/rest/api/v3/templates/api_delete_template_version.go new file mode 100644 index 00000000..761b8d6e --- /dev/null +++ b/rest/api/v3/templates/api_delete_template_version.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "net/http" + "net/url" + + "strings" +) + +type DeleteTemplateVersionParam struct { + // The ID of the original template + TemplateId *string `json:"template_id"` + // The ID of the template version + VersionId *string `json:"version_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteTemplateVersionParam) SetTemplateId(TemplateId string) *DeleteTemplateVersionParam { + params.TemplateId = &TemplateId + return params +} +func (params *DeleteTemplateVersionParam) SetVersionId(VersionId string) *DeleteTemplateVersionParam { + params.VersionId = &VersionId + return params +} +func (params *DeleteTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *DeleteTemplateVersionParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a transactional template version.** +func (c *ApiService) DeleteTemplateVersion(params *DeleteTemplateVersionParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}/versions/{VersionId}" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + if params != nil && params.VersionId != nil { + path = strings.Replace(path, "{"+"VersionId"+"}", *params.VersionId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_duplicate_template.go b/rest/api/v3/templates/api_duplicate_template.go new file mode 100644 index 00000000..58551315 --- /dev/null +++ b/rest/api/v3/templates/api_duplicate_template.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DuplicateTemplateParam struct { + // + TemplateId *string `json:"template_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + DuplicateTemplateRequest *DuplicateTemplateRequest `json:"DuplicateTemplateRequest,omitempty"` +} + +func (params *DuplicateTemplateParam) SetTemplateId(TemplateId string) *DuplicateTemplateParam { + params.TemplateId = &TemplateId + return params +} +func (params *DuplicateTemplateParam) SetOnbehalfof(Onbehalfof string) *DuplicateTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *DuplicateTemplateParam) SetDuplicateTemplateRequest(DuplicateTemplateRequest DuplicateTemplateRequest) *DuplicateTemplateParam { + params.DuplicateTemplateRequest = &DuplicateTemplateRequest + return params +} + +// **This endpoint allows you to duplicate a transactional template.** +func (c *ApiService) DuplicateTemplate(params *DuplicateTemplateParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.DuplicateTemplateRequest != nil { + b, err := json.Marshal(*params.DuplicateTemplateRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &TransactionalTemplate{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_get_template.go b/rest/api/v3/templates/api_get_template.go new file mode 100644 index 00000000..9df68311 --- /dev/null +++ b/rest/api/v3/templates/api_get_template.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetTemplateParam struct { + // + TemplateId *string `json:"template_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetTemplateParam) SetTemplateId(TemplateId string) *GetTemplateParam { + params.TemplateId = &TemplateId + return params +} +func (params *GetTemplateParam) SetOnbehalfof(Onbehalfof string) *GetTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a single transactional template.** +func (c *ApiService) GetTemplate(params *GetTemplateParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &TransactionalTemplate{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_get_template_version.go b/rest/api/v3/templates/api_get_template_version.go new file mode 100644 index 00000000..5b6e002d --- /dev/null +++ b/rest/api/v3/templates/api_get_template_version.go @@ -0,0 +1,79 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetTemplateVersionParam struct { + // The ID of the original template + TemplateId *string `json:"template_id"` + // The ID of the template version + VersionId *string `json:"version_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetTemplateVersionParam) SetTemplateId(TemplateId string) *GetTemplateVersionParam { + params.TemplateId = &TemplateId + return params +} +func (params *GetTemplateVersionParam) SetVersionId(VersionId string) *GetTemplateVersionParam { + params.VersionId = &VersionId + return params +} +func (params *GetTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *GetTemplateVersionParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific version of a template.** +func (c *ApiService) GetTemplateVersion(params *GetTemplateVersionParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}/versions/{VersionId}" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + if params != nil && params.VersionId != nil { + path = strings.Replace(path, "{"+"VersionId"+"}", *params.VersionId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &TransactionalTemplateVersionOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_list_template.go b/rest/api/v3/templates/api_list_template.go new file mode 100644 index 00000000..6ad261eb --- /dev/null +++ b/rest/api/v3/templates/api_list_template.go @@ -0,0 +1,96 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListTemplateParam struct { + // The number of templates to be returned in each page of results + PageSize *float32 `json:"page_size"` + // Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`. + Generations *Generations `json:"generations,omitempty"` + // A token corresponding to a specific page of results, as provided by metadata + PageToken *string `json:"page_token,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListTemplateParam) SetPageSize(PageSize float32) *ListTemplateParam { + params.PageSize = &PageSize + return params +} +func (params *ListTemplateParam) SetGenerations(Generations Generations) *ListTemplateParam { + params.Generations = &Generations + return params +} +func (params *ListTemplateParam) SetPageToken(PageToken string) *ListTemplateParam { + params.PageToken = &PageToken + return params +} +func (params *ListTemplateParam) SetOnbehalfof(Onbehalfof string) *ListTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all transactional templates.** +func (c *ApiService) ListTemplate(params *ListTemplateParam) (interface{}, error) { + path := "/v3/templates" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.PageSize != nil { + data.Set("page_size", fmt.Sprint(*params.PageSize)) + } + if params != nil && params.Generations != nil { + data.Set("generations", fmt.Sprint(*params.Generations)) + } + if params != nil && params.PageToken != nil { + data.Set("page_token", *params.PageToken) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListTemplate200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &ListTemplate400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_service.go b/rest/api/v3/templates/api_service.go new file mode 100644 index 00000000..3716cd28 --- /dev/null +++ b/rest/api/v3/templates/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/templates/api_update_template.go b/rest/api/v3/templates/api_update_template.go new file mode 100644 index 00000000..29317d5b --- /dev/null +++ b/rest/api/v3/templates/api_update_template.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateTemplateParam struct { + // + TemplateId *string `json:"template_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateTemplateRequest *UpdateTemplateRequest `json:"UpdateTemplateRequest,omitempty"` +} + +func (params *UpdateTemplateParam) SetTemplateId(TemplateId string) *UpdateTemplateParam { + params.TemplateId = &TemplateId + return params +} +func (params *UpdateTemplateParam) SetOnbehalfof(Onbehalfof string) *UpdateTemplateParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateTemplateParam) SetUpdateTemplateRequest(UpdateTemplateRequest UpdateTemplateRequest) *UpdateTemplateParam { + params.UpdateTemplateRequest = &UpdateTemplateRequest + return params +} + +// **This endpoint allows you to edit the name of a transactional template.** To edit the template itself, [create a new transactional template version](https://docs.sendgrid.com/api-reference/transactional-templates-versions/create-a-new-transactional-template-version). +func (c *ApiService) UpdateTemplate(params *UpdateTemplateParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateTemplateRequest != nil { + b, err := json.Marshal(*params.UpdateTemplateRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &TransactionalTemplate{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/api_update_template_version.go b/rest/api/v3/templates/api_update_template_version.go new file mode 100644 index 00000000..74d7aedf --- /dev/null +++ b/rest/api/v3/templates/api_update_template_version.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateTemplateVersionParam struct { + // The ID of the original template + TemplateId *string `json:"template_id"` + // The ID of the template version + VersionId *string `json:"version_id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + TransactionalTemplateVersionCreate *TransactionalTemplateVersionCreate `json:"TransactionalTemplateVersionCreate,omitempty"` +} + +func (params *UpdateTemplateVersionParam) SetTemplateId(TemplateId string) *UpdateTemplateVersionParam { + params.TemplateId = &TemplateId + return params +} +func (params *UpdateTemplateVersionParam) SetVersionId(VersionId string) *UpdateTemplateVersionParam { + params.VersionId = &VersionId + return params +} +func (params *UpdateTemplateVersionParam) SetOnbehalfof(Onbehalfof string) *UpdateTemplateVersionParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateTemplateVersionParam) SetTransactionalTemplateVersionCreate(TransactionalTemplateVersionCreate TransactionalTemplateVersionCreate) *UpdateTemplateVersionParam { + params.TransactionalTemplateVersionCreate = &TransactionalTemplateVersionCreate + return params +} + +// **This endpoint allows you to edit the content of your template version.** +func (c *ApiService) UpdateTemplateVersion(params *UpdateTemplateVersionParam) (interface{}, error) { + path := "/v3/templates/{TemplateId}/versions/{VersionId}" + if params != nil && params.TemplateId != nil { + path = strings.Replace(path, "{"+"TemplateId"+"}", *params.TemplateId, -1) + } + if params != nil && params.VersionId != nil { + path = strings.Replace(path, "{"+"VersionId"+"}", *params.VersionId, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.TransactionalTemplateVersionCreate != nil { + b, err := json.Marshal(*params.TransactionalTemplateVersionCreate) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &TransactionalTemplateVersionOutput{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/templates/docs/ActivateTemplateVersion.md b/rest/api/v3/templates/docs/ActivateTemplateVersion.md new file mode 100644 index 00000000..501c4c70 --- /dev/null +++ b/rest/api/v3/templates/docs/ActivateTemplateVersion.md @@ -0,0 +1,53 @@ +# ActivateTemplateVersion + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActivateTemplateVersion**](ActivateTemplateVersion.md#ActivateTemplateVersion) | **Post** /v3/templates/{TemplateId}/versions/{VersionId}/activate | Activate a transactional template version. + + + +## ActivateTemplateVersion + +> TransactionalTemplateVersionOutput ActivateTemplateVersion(ctx, TemplateIdVersionIdoptional) + +Activate a transactional template version. + +**This endpoint allows you to activate a version of one of your templates.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | The ID of the original template +**VersionId** | **string** | The ID of the template version + +### Other Parameters + +Other parameters are passed through a pointer to a ActivateTemplateVersionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**TransactionalTemplateVersionOutput**](TransactionalTemplateVersionOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/Active.md b/rest/api/v3/templates/docs/Active.md new file mode 100644 index 00000000..d69716ca --- /dev/null +++ b/rest/api/v3/templates/docs/Active.md @@ -0,0 +1,13 @@ +# Active + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**_0** | int32 | (value: `0`) +**_1** | int32 | (value: `1`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/Active1.md b/rest/api/v3/templates/docs/Active1.md new file mode 100644 index 00000000..4b05d8e0 --- /dev/null +++ b/rest/api/v3/templates/docs/Active1.md @@ -0,0 +1,13 @@ +# Active1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**_0** | int32 | (value: `0`) +**_1** | int32 | (value: `1`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/CreateTemplate.md b/rest/api/v3/templates/docs/CreateTemplate.md new file mode 100644 index 00000000..ae22f59f --- /dev/null +++ b/rest/api/v3/templates/docs/CreateTemplate.md @@ -0,0 +1,49 @@ +# CreateTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateTemplate**](CreateTemplate.md#CreateTemplate) | **Post** /v3/templates | Create a transactional template. + + + +## CreateTemplate + +> TransactionalTemplate CreateTemplate(ctx, optional) + +Create a transactional template. + +**This endpoint allows you to create a transactional template.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**CreateTemplateRequest** | [**CreateTemplateRequest**](CreateTemplateRequest.md) | + +### Return type + +[**TransactionalTemplate**](TransactionalTemplate.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/CreateTemplateRequest.md b/rest/api/v3/templates/docs/CreateTemplateRequest.md new file mode 100644 index 00000000..3257102d --- /dev/null +++ b/rest/api/v3/templates/docs/CreateTemplateRequest.md @@ -0,0 +1,12 @@ +# CreateTemplateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name for the new transactional template. | +**Generation** | [**Generation**](Generation.md) | Defines whether the template supports dynamic replacement. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/CreateTemplateVersion.md b/rest/api/v3/templates/docs/CreateTemplateVersion.md new file mode 100644 index 00000000..e5ba2395 --- /dev/null +++ b/rest/api/v3/templates/docs/CreateTemplateVersion.md @@ -0,0 +1,53 @@ +# CreateTemplateVersion + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateTemplateVersion**](CreateTemplateVersion.md#CreateTemplateVersion) | **Post** /v3/templates/{TemplateId}/versions | Create a new transactional template version. + + + +## CreateTemplateVersion + +> TransactionalTemplateVersionOutput CreateTemplateVersion(ctx, TemplateIdoptional) + +Create a new transactional template version. + +**This endpoint allows you to create a new version of a template.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a CreateTemplateVersionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**TransactionalTemplateVersionCreate** | [**TransactionalTemplateVersionCreate**](TransactionalTemplateVersionCreate.md) | + +### Return type + +[**TransactionalTemplateVersionOutput**](TransactionalTemplateVersionOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/DeleteTemplate.md b/rest/api/v3/templates/docs/DeleteTemplate.md new file mode 100644 index 00000000..fa5ca8f0 --- /dev/null +++ b/rest/api/v3/templates/docs/DeleteTemplate.md @@ -0,0 +1,52 @@ +# DeleteTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteTemplate**](DeleteTemplate.md#DeleteTemplate) | **Delete** /v3/templates/{TemplateId} | Delete a template. + + + +## DeleteTemplate + +> map[string]interface{} DeleteTemplate(ctx, TemplateIdoptional) + +Delete a template. + +**This endpoint allows you to delete a transactional template.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/DeleteTemplateVersion.md b/rest/api/v3/templates/docs/DeleteTemplateVersion.md new file mode 100644 index 00000000..a0a2bf5c --- /dev/null +++ b/rest/api/v3/templates/docs/DeleteTemplateVersion.md @@ -0,0 +1,53 @@ +# DeleteTemplateVersion + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteTemplateVersion**](DeleteTemplateVersion.md#DeleteTemplateVersion) | **Delete** /v3/templates/{TemplateId}/versions/{VersionId} | Delete a transactional template version. + + + +## DeleteTemplateVersion + +> DeleteTemplateVersion(ctx, TemplateIdVersionIdoptional) + +Delete a transactional template version. + +**This endpoint allows you to delete a transactional template version.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | The ID of the original template +**VersionId** | **string** | The ID of the template version + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteTemplateVersionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/DuplicateTemplate.md b/rest/api/v3/templates/docs/DuplicateTemplate.md new file mode 100644 index 00000000..b1ff510b --- /dev/null +++ b/rest/api/v3/templates/docs/DuplicateTemplate.md @@ -0,0 +1,53 @@ +# DuplicateTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DuplicateTemplate**](DuplicateTemplate.md#DuplicateTemplate) | **Post** /v3/templates/{TemplateId} | Duplicate a transactional template. + + + +## DuplicateTemplate + +> TransactionalTemplate DuplicateTemplate(ctx, TemplateIdoptional) + +Duplicate a transactional template. + +**This endpoint allows you to duplicate a transactional template.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DuplicateTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**DuplicateTemplateRequest** | [**DuplicateTemplateRequest**](DuplicateTemplateRequest.md) | + +### Return type + +[**TransactionalTemplate**](TransactionalTemplate.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/DuplicateTemplateRequest.md b/rest/api/v3/templates/docs/DuplicateTemplateRequest.md new file mode 100644 index 00000000..02a361b6 --- /dev/null +++ b/rest/api/v3/templates/docs/DuplicateTemplateRequest.md @@ -0,0 +1,11 @@ +# DuplicateTemplateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name for the new transactional template. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/Editor.md b/rest/api/v3/templates/docs/Editor.md new file mode 100644 index 00000000..9d170841 --- /dev/null +++ b/rest/api/v3/templates/docs/Editor.md @@ -0,0 +1,13 @@ +# Editor + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CODE** | string | (value: `"code"`) +**DESIGN** | string | (value: `"design"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/Editor1.md b/rest/api/v3/templates/docs/Editor1.md new file mode 100644 index 00000000..2ddc5d89 --- /dev/null +++ b/rest/api/v3/templates/docs/Editor1.md @@ -0,0 +1,13 @@ +# Editor1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**CODE** | string | (value: `"code"`) +**DESIGN** | string | (value: `"design"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/Generation.md b/rest/api/v3/templates/docs/Generation.md new file mode 100644 index 00000000..04e09451 --- /dev/null +++ b/rest/api/v3/templates/docs/Generation.md @@ -0,0 +1,13 @@ +# Generation + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**LEGACY** | string | (value: `"legacy"`) +**DYNAMIC** | string | (value: `"dynamic"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/Generation1.md b/rest/api/v3/templates/docs/Generation1.md new file mode 100644 index 00000000..7b1f26b0 --- /dev/null +++ b/rest/api/v3/templates/docs/Generation1.md @@ -0,0 +1,13 @@ +# Generation1 + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**LEGACY** | string | (value: `"legacy"`) +**DYNAMIC** | string | (value: `"dynamic"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/Generations.md b/rest/api/v3/templates/docs/Generations.md new file mode 100644 index 00000000..61e985f0 --- /dev/null +++ b/rest/api/v3/templates/docs/Generations.md @@ -0,0 +1,14 @@ +# Generations + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**LEGACY** | string | (value: `"legacy"`) +**DYNAMIC** | string | (value: `"dynamic"`) +**LEGACYDYNAMIC** | string | (value: `"legacy,dynamic"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/GetTemplate.md b/rest/api/v3/templates/docs/GetTemplate.md new file mode 100644 index 00000000..6deed867 --- /dev/null +++ b/rest/api/v3/templates/docs/GetTemplate.md @@ -0,0 +1,52 @@ +# GetTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetTemplate**](GetTemplate.md#GetTemplate) | **Get** /v3/templates/{TemplateId} | Retrieve a single transactional template. + + + +## GetTemplate + +> TransactionalTemplate GetTemplate(ctx, TemplateIdoptional) + +Retrieve a single transactional template. + +**This endpoint allows you to retrieve a single transactional template.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a GetTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**TransactionalTemplate**](TransactionalTemplate.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/GetTemplateVersion.md b/rest/api/v3/templates/docs/GetTemplateVersion.md new file mode 100644 index 00000000..8beed210 --- /dev/null +++ b/rest/api/v3/templates/docs/GetTemplateVersion.md @@ -0,0 +1,53 @@ +# GetTemplateVersion + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetTemplateVersion**](GetTemplateVersion.md#GetTemplateVersion) | **Get** /v3/templates/{TemplateId}/versions/{VersionId} | Retrieve a specific transactional template version. + + + +## GetTemplateVersion + +> TransactionalTemplateVersionOutput GetTemplateVersion(ctx, TemplateIdVersionIdoptional) + +Retrieve a specific transactional template version. + +**This endpoint allows you to retrieve a specific version of a template.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | The ID of the original template +**VersionId** | **string** | The ID of the template version + +### Other Parameters + +Other parameters are passed through a pointer to a GetTemplateVersionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**TransactionalTemplateVersionOutput**](TransactionalTemplateVersionOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/ListTemplate.md b/rest/api/v3/templates/docs/ListTemplate.md new file mode 100644 index 00000000..f6af7acd --- /dev/null +++ b/rest/api/v3/templates/docs/ListTemplate.md @@ -0,0 +1,50 @@ +# ListTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListTemplate**](ListTemplate.md#ListTemplate) | **Get** /v3/templates | Retrieve paged transactional templates. + + + +## ListTemplate + +> ListTemplate200Response ListTemplate(ctx, PageSizeoptional) + +Retrieve paged transactional templates. + +**This endpoint allows you to retrieve all transactional templates.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Generations** | [**Generations**](GenerationsGenerations.md) | Comma-delimited list specifying which generations of templates to return. Options are `legacy`, `dynamic` or `legacy,dynamic`. +**PageToken** | **string** | A token corresponding to a specific page of results, as provided by metadata +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListTemplate200Response**](ListTemplate200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/ListTemplate200Response.md b/rest/api/v3/templates/docs/ListTemplate200Response.md new file mode 100644 index 00000000..5ec1a162 --- /dev/null +++ b/rest/api/v3/templates/docs/ListTemplate200Response.md @@ -0,0 +1,12 @@ +# ListTemplate200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]TransactionalTemplatesTemplateLean**](TransactionalTemplatesTemplateLean.md) | |[optional] +**Metadata** | [**Metadata**](Metadata.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/ListTemplate400Response.md b/rest/api/v3/templates/docs/ListTemplate400Response.md new file mode 100644 index 00000000..006916af --- /dev/null +++ b/rest/api/v3/templates/docs/ListTemplate400Response.md @@ -0,0 +1,11 @@ +# ListTemplate400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ListTemplate400ResponseErrorsInner**](ListTemplate400ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/ListTemplate400ResponseErrorsInner.md b/rest/api/v3/templates/docs/ListTemplate400ResponseErrorsInner.md new file mode 100644 index 00000000..a1aaa499 --- /dev/null +++ b/rest/api/v3/templates/docs/ListTemplate400ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# ListTemplate400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | |[optional] +**ErrorId** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/Metadata.md b/rest/api/v3/templates/docs/Metadata.md new file mode 100644 index 00000000..6121300c --- /dev/null +++ b/rest/api/v3/templates/docs/Metadata.md @@ -0,0 +1,14 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prev** | **string** | |[optional] +**Self** | **string** | |[optional] +**Next** | **string** | |[optional] +**Count** | **int32** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/TransactionalTemplate.md b/rest/api/v3/templates/docs/TransactionalTemplate.md new file mode 100644 index 00000000..9d4b55ca --- /dev/null +++ b/rest/api/v3/templates/docs/TransactionalTemplate.md @@ -0,0 +1,16 @@ +# TransactionalTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of the transactional template. | +**Name** | **string** | The name for the transactional template. | +**Generation** | [**Generation1**](Generation1.md) | Defines the generation of the template. | +**UpdatedAt** | **string** | The date and time that this transactional template version was updated. | +**Versions** | [**[]TransactionalTemplatesVersionOutputLean**](TransactionalTemplatesVersionOutputLean.md) | The different versions of this transactional template. |[optional] +**Warning** | [**TransactionalTemplateWarning**](TransactionalTemplateWarning.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/TransactionalTemplateVersionCreate.md b/rest/api/v3/templates/docs/TransactionalTemplateVersionCreate.md new file mode 100644 index 00000000..958d7c58 --- /dev/null +++ b/rest/api/v3/templates/docs/TransactionalTemplateVersionCreate.md @@ -0,0 +1,18 @@ +# TransactionalTemplateVersionCreate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Active** | [**Active**](Active.md) | Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active. |[optional] +**Name** | **string** | Name of the transactional template version. | +**HtmlContent** | **string** | The HTML content of the version. Maximum of 1048576 bytes allowed. |[optional] +**PlainContent** | **string** | Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed. |[optional] [default to ""] +**GeneratePlainContent** | **bool** | If true, plain_content is always generated from html_content. If false, plain_content is not altered. |[optional] [default to true] +**Subject** | **string** | Subject of the new transactional template version. | +**Editor** | [**Editor**](Editor.md) | The editor used in the UI. |[optional] +**TestData** | **string** | For dynamic templates only, the mock json data that will be used for template preview and test sends. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/TransactionalTemplateVersionOutput.md b/rest/api/v3/templates/docs/TransactionalTemplateVersionOutput.md new file mode 100644 index 00000000..b2b0e299 --- /dev/null +++ b/rest/api/v3/templates/docs/TransactionalTemplateVersionOutput.md @@ -0,0 +1,23 @@ +# TransactionalTemplateVersionOutput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Warnings** | [**[]TransactionalTemplateWarning**](TransactionalTemplateWarning.md) | |[optional] +**Active** | [**Active1**](Active1.md) | Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active. |[optional] +**Name** | **string** | Name of the transactional template version. | +**HtmlContent** | **string** | The HTML content of the Design. |[optional] +**PlainContent** | **string** | Plain text content of the Design. |[optional] +**GeneratePlainContent** | **bool** | If true, plain_content is always generated from html_content. If false, plain_content is not altered. |[optional] [default to true] +**Subject** | **string** | Subject of the new transactional template version. | +**Editor** | [**Editor1**](Editor1.md) | The editor used in the UI. |[optional] +**TestData** | **string** | For dynamic templates only, the mock json data that will be used for template preview and test sends. |[optional] +**Id** | **string** | ID of the transactional template version. |[optional] +**TemplateId** | **string** | ID of the transactional template. |[optional] +**UpdatedAt** | **string** | The date and time that this transactional template version was updated. |[optional] +**ThumbnailUrl** | **string** | A Thumbnail preview of the template's html content. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/TransactionalTemplateWarning.md b/rest/api/v3/templates/docs/TransactionalTemplateWarning.md new file mode 100644 index 00000000..0b22b1bd --- /dev/null +++ b/rest/api/v3/templates/docs/TransactionalTemplateWarning.md @@ -0,0 +1,11 @@ +# TransactionalTemplateWarning + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | Warning message for the user |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/TransactionalTemplatesTemplateLean.md b/rest/api/v3/templates/docs/TransactionalTemplatesTemplateLean.md new file mode 100644 index 00000000..631f5def --- /dev/null +++ b/rest/api/v3/templates/docs/TransactionalTemplatesTemplateLean.md @@ -0,0 +1,15 @@ +# TransactionalTemplatesTemplateLean + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of the transactional template. | +**Name** | **string** | The name for the transactional template. | +**Generation** | [**Generation1**](Generation1.md) | Defines the generation of the template. | +**UpdatedAt** | **string** | The date and time that this transactional template version was updated. | +**Versions** | [**[]TransactionalTemplatesVersionOutputLean**](TransactionalTemplatesVersionOutputLean.md) | The different versions of this transactional template. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/TransactionalTemplatesVersionOutputLean.md b/rest/api/v3/templates/docs/TransactionalTemplatesVersionOutputLean.md new file mode 100644 index 00000000..0462c525 --- /dev/null +++ b/rest/api/v3/templates/docs/TransactionalTemplatesVersionOutputLean.md @@ -0,0 +1,21 @@ +# TransactionalTemplatesVersionOutputLean + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | ID of the transactional template version. |[optional] +**TemplateId** | **string** | ID of the transactional template. |[optional] +**Active** | [**Active1**](Active1.md) | Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active. |[optional] +**Name** | **string** | Name of the transactional template version. |[optional] +**Subject** | **string** | Subject of the new transactional template version. |[optional] +**UpdatedAt** | **string** | The date and time that this transactional template version was updated. |[optional] +**GeneratePlainContent** | **bool** | If true, plain_content is always generated from html_content. If false, plain_content is not altered. |[optional] [default to true] +**HtmlContent** | **string** | The HTML content of the Design. |[optional] +**PlainContent** | **string** | Plain text content of the Design. |[optional] +**Editor** | [**Editor1**](Editor1.md) | The editor used in the UI. |[optional] +**ThumbnailUrl** | **string** | A Thumbnail preview of the template's html content. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/UpdateTemplate.md b/rest/api/v3/templates/docs/UpdateTemplate.md new file mode 100644 index 00000000..ca71abfb --- /dev/null +++ b/rest/api/v3/templates/docs/UpdateTemplate.md @@ -0,0 +1,53 @@ +# UpdateTemplate + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateTemplate**](UpdateTemplate.md#UpdateTemplate) | **Patch** /v3/templates/{TemplateId} | Edit a transactional template. + + + +## UpdateTemplate + +> TransactionalTemplate UpdateTemplate(ctx, TemplateIdoptional) + +Edit a transactional template. + +**This endpoint allows you to edit the name of a transactional template.** To edit the template itself, [create a new transactional template version](https://docs.sendgrid.com/api-reference/transactional-templates-versions/create-a-new-transactional-template-version). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateTemplateParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateTemplateRequest** | [**UpdateTemplateRequest**](UpdateTemplateRequest.md) | + +### Return type + +[**TransactionalTemplate**](TransactionalTemplate.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/docs/UpdateTemplateRequest.md b/rest/api/v3/templates/docs/UpdateTemplateRequest.md new file mode 100644 index 00000000..beb9d891 --- /dev/null +++ b/rest/api/v3/templates/docs/UpdateTemplateRequest.md @@ -0,0 +1,11 @@ +# UpdateTemplateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the transactional template. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/templates/docs/UpdateTemplateVersion.md b/rest/api/v3/templates/docs/UpdateTemplateVersion.md new file mode 100644 index 00000000..79ab9221 --- /dev/null +++ b/rest/api/v3/templates/docs/UpdateTemplateVersion.md @@ -0,0 +1,54 @@ +# UpdateTemplateVersion + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateTemplateVersion**](UpdateTemplateVersion.md#UpdateTemplateVersion) | **Patch** /v3/templates/{TemplateId}/versions/{VersionId} | Edit a transactional template version. + + + +## UpdateTemplateVersion + +> TransactionalTemplateVersionOutput UpdateTemplateVersion(ctx, TemplateIdVersionIdoptional) + +Edit a transactional template version. + +**This endpoint allows you to edit the content of your template version.** + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**TemplateId** | **string** | The ID of the original template +**VersionId** | **string** | The ID of the template version + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateTemplateVersionParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**TransactionalTemplateVersionCreate** | [**TransactionalTemplateVersionCreate**](TransactionalTemplateVersionCreate.md) | + +### Return type + +[**TransactionalTemplateVersionOutput**](TransactionalTemplateVersionOutput.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/templates/model_active.go b/rest/api/v3/templates/model_active.go new file mode 100644 index 00000000..f2cf3f4c --- /dev/null +++ b/rest/api/v3/templates/model_active.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Active the model 'Active' +type Active int32 + +// List of Active +const ( + ACTIVE__0 Active = 0 + ACTIVE__1 Active = 1 +) diff --git a/rest/api/v3/templates/model_active1.go b/rest/api/v3/templates/model_active1.go new file mode 100644 index 00000000..063d82be --- /dev/null +++ b/rest/api/v3/templates/model_active1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Active1 the model 'Active1' +type Active1 int32 + +// List of Active1 +const ( + ACTIVE1__0 Active1 = 0 + ACTIVE1__1 Active1 = 1 +) diff --git a/rest/api/v3/templates/model_create_template_request.go b/rest/api/v3/templates/model_create_template_request.go new file mode 100644 index 00000000..d2dcd300 --- /dev/null +++ b/rest/api/v3/templates/model_create_template_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateTemplateRequest struct for CreateTemplateRequest +type CreateTemplateRequest struct { + // The name for the new transactional template. + Name string `json:"name"` + // Defines whether the template supports dynamic replacement. + Generation *Generation `json:"generation,omitempty"` +} diff --git a/rest/api/v3/templates/model_duplicate_template_request.go b/rest/api/v3/templates/model_duplicate_template_request.go new file mode 100644 index 00000000..7b69dd8e --- /dev/null +++ b/rest/api/v3/templates/model_duplicate_template_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DuplicateTemplateRequest struct for DuplicateTemplateRequest +type DuplicateTemplateRequest struct { + // The name for the new transactional template. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/templates/model_editor.go b/rest/api/v3/templates/model_editor.go new file mode 100644 index 00000000..e4bfb1be --- /dev/null +++ b/rest/api/v3/templates/model_editor.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Editor the model 'Editor' +type Editor string + +// List of Editor +const ( + EDITOR_CODE Editor = "code" + EDITOR_DESIGN Editor = "design" +) diff --git a/rest/api/v3/templates/model_editor1.go b/rest/api/v3/templates/model_editor1.go new file mode 100644 index 00000000..6fabeaf4 --- /dev/null +++ b/rest/api/v3/templates/model_editor1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Editor1 the model 'Editor1' +type Editor1 string + +// List of Editor1 +const ( + EDITOR1_CODE Editor1 = "code" + EDITOR1_DESIGN Editor1 = "design" +) diff --git a/rest/api/v3/templates/model_generation.go b/rest/api/v3/templates/model_generation.go new file mode 100644 index 00000000..7056829d --- /dev/null +++ b/rest/api/v3/templates/model_generation.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Generation the model 'Generation' +type Generation string + +// List of Generation +const ( + GENERATION_LEGACY Generation = "legacy" + GENERATION_DYNAMIC Generation = "dynamic" +) diff --git a/rest/api/v3/templates/model_generation1.go b/rest/api/v3/templates/model_generation1.go new file mode 100644 index 00000000..49ece636 --- /dev/null +++ b/rest/api/v3/templates/model_generation1.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Generation1 the model 'Generation1' +type Generation1 string + +// List of Generation1 +const ( + GENERATION1_LEGACY Generation1 = "legacy" + GENERATION1_DYNAMIC Generation1 = "dynamic" +) diff --git a/rest/api/v3/templates/model_generations.go b/rest/api/v3/templates/model_generations.go new file mode 100644 index 00000000..1c57da46 --- /dev/null +++ b/rest/api/v3/templates/model_generations.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Generations the model 'Generations' +type Generations string + +// List of Generations +const ( + GENERATIONS_LEGACY Generations = "legacy" + GENERATIONS_DYNAMIC Generations = "dynamic" + GENERATIONS_LEGACYDYNAMIC Generations = "legacy,dynamic" +) diff --git a/rest/api/v3/templates/model_list_template_200_response.go b/rest/api/v3/templates/model_list_template_200_response.go new file mode 100644 index 00000000..6cb5f0a0 --- /dev/null +++ b/rest/api/v3/templates/model_list_template_200_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListTemplate200Response struct for ListTemplate200Response +type ListTemplate200Response struct { + // + Result *[]TransactionalTemplatesTemplateLean `json:"result,omitempty"` + Metadata *Metadata `json:"_metadata,omitempty"` +} diff --git a/rest/api/v3/templates/model_list_template_400_response.go b/rest/api/v3/templates/model_list_template_400_response.go new file mode 100644 index 00000000..b2834d68 --- /dev/null +++ b/rest/api/v3/templates/model_list_template_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListTemplate400Response struct for ListTemplate400Response +type ListTemplate400Response struct { + Errors *[]ListTemplate400ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/templates/model_list_template_400_response_errors_inner.go b/rest/api/v3/templates/model_list_template_400_response_errors_inner.go new file mode 100644 index 00000000..dd133220 --- /dev/null +++ b/rest/api/v3/templates/model_list_template_400_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListTemplate400ResponseErrorsInner struct for ListTemplate400ResponseErrorsInner +type ListTemplate400ResponseErrorsInner struct { + Message *string `json:"message,omitempty"` + ErrorId *string `json:"error_id,omitempty"` +} diff --git a/rest/api/v3/templates/model_metadata.go b/rest/api/v3/templates/model_metadata.go new file mode 100644 index 00000000..20681118 --- /dev/null +++ b/rest/api/v3/templates/model_metadata.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Metadata struct for Metadata +type Metadata struct { + Prev *string `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + Next *string `json:"next,omitempty"` + Count *int32 `json:"count,omitempty"` +} diff --git a/rest/api/v3/templates/model_transactional_template.go b/rest/api/v3/templates/model_transactional_template.go new file mode 100644 index 00000000..2298d217 --- /dev/null +++ b/rest/api/v3/templates/model_transactional_template.go @@ -0,0 +1,29 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// TransactionalTemplate struct for TransactionalTemplate +type TransactionalTemplate struct { + // The ID of the transactional template. + Id string `json:"id"` + // The name for the transactional template. + Name string `json:"name"` + // Defines the generation of the template. + Generation Generation1 `json:"generation"` + // The date and time that this transactional template version was updated. + UpdatedAt string `json:"updated_at"` + // The different versions of this transactional template. + Versions *[]TransactionalTemplatesVersionOutputLean `json:"versions,omitempty"` + Warning *TransactionalTemplateWarning `json:"warning,omitempty"` +} diff --git a/rest/api/v3/templates/model_transactional_template_version_create.go b/rest/api/v3/templates/model_transactional_template_version_create.go new file mode 100644 index 00000000..876459d7 --- /dev/null +++ b/rest/api/v3/templates/model_transactional_template_version_create.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// TransactionalTemplateVersionCreate struct for TransactionalTemplateVersionCreate +type TransactionalTemplateVersionCreate struct { + // Set the version as the active version associated with the template (0 is inactive, 1 is active). Only one version of a template can be active. The first version created for a template will automatically be set to Active. + Active *Active `json:"active,omitempty"` + // Name of the transactional template version. + Name string `json:"name"` + // The HTML content of the version. Maximum of 1048576 bytes allowed. + HtmlContent *string `json:"html_content,omitempty"` + // Text/plain content of the transactional template version. Maximum of 1048576 bytes allowed. + PlainContent *string `json:"plain_content,omitempty"` + // If true, plain_content is always generated from html_content. If false, plain_content is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // Subject of the new transactional template version. + Subject string `json:"subject"` + // The editor used in the UI. + Editor *Editor `json:"editor,omitempty"` + // For dynamic templates only, the mock json data that will be used for template preview and test sends. + TestData *string `json:"test_data,omitempty"` +} diff --git a/rest/api/v3/templates/model_transactional_template_version_output.go b/rest/api/v3/templates/model_transactional_template_version_output.go new file mode 100644 index 00000000..5874ebbe --- /dev/null +++ b/rest/api/v3/templates/model_transactional_template_version_output.go @@ -0,0 +1,43 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// TransactionalTemplateVersionOutput struct for TransactionalTemplateVersionOutput +type TransactionalTemplateVersionOutput struct { + Warnings *[]TransactionalTemplateWarning `json:"warnings,omitempty"` + // Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active. + Active *Active1 `json:"active,omitempty"` + // Name of the transactional template version. + Name string `json:"name"` + // The HTML content of the Design. + HtmlContent *string `json:"html_content,omitempty"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` + // If true, plain_content is always generated from html_content. If false, plain_content is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // Subject of the new transactional template version. + Subject string `json:"subject"` + // The editor used in the UI. + Editor *Editor1 `json:"editor,omitempty"` + // For dynamic templates only, the mock json data that will be used for template preview and test sends. + TestData *string `json:"test_data,omitempty"` + // ID of the transactional template version. + Id *string `json:"id,omitempty"` + // ID of the transactional template. + TemplateId *string `json:"template_id,omitempty"` + // The date and time that this transactional template version was updated. + UpdatedAt *string `json:"updated_at,omitempty"` + // A Thumbnail preview of the template's html content. + ThumbnailUrl *string `json:"thumbnail_url,omitempty"` +} diff --git a/rest/api/v3/templates/model_transactional_template_warning.go b/rest/api/v3/templates/model_transactional_template_warning.go new file mode 100644 index 00000000..3d110410 --- /dev/null +++ b/rest/api/v3/templates/model_transactional_template_warning.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// TransactionalTemplateWarning struct for TransactionalTemplateWarning +type TransactionalTemplateWarning struct { + // Warning message for the user + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/templates/model_transactional_templates_template_lean.go b/rest/api/v3/templates/model_transactional_templates_template_lean.go new file mode 100644 index 00000000..eb295990 --- /dev/null +++ b/rest/api/v3/templates/model_transactional_templates_template_lean.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// TransactionalTemplatesTemplateLean struct for TransactionalTemplatesTemplateLean +type TransactionalTemplatesTemplateLean struct { + // The ID of the transactional template. + Id string `json:"id"` + // The name for the transactional template. + Name string `json:"name"` + // Defines the generation of the template. + Generation Generation1 `json:"generation"` + // The date and time that this transactional template version was updated. + UpdatedAt string `json:"updated_at"` + // The different versions of this transactional template. + Versions *[]TransactionalTemplatesVersionOutputLean `json:"versions,omitempty"` +} diff --git a/rest/api/v3/templates/model_transactional_templates_version_output_lean.go b/rest/api/v3/templates/model_transactional_templates_version_output_lean.go new file mode 100644 index 00000000..47f42a36 --- /dev/null +++ b/rest/api/v3/templates/model_transactional_templates_version_output_lean.go @@ -0,0 +1,40 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// TransactionalTemplatesVersionOutputLean struct for TransactionalTemplatesVersionOutputLean +type TransactionalTemplatesVersionOutputLean struct { + // ID of the transactional template version. + Id *string `json:"id,omitempty"` + // ID of the transactional template. + TemplateId *string `json:"template_id,omitempty"` + // Set the version as the active version associated with the template. Only one version of a template can be active. The first version created for a template will automatically be set to Active. + Active *Active1 `json:"active,omitempty"` + // Name of the transactional template version. + Name *string `json:"name,omitempty"` + // Subject of the new transactional template version. + Subject *string `json:"subject,omitempty"` + // The date and time that this transactional template version was updated. + UpdatedAt *string `json:"updated_at,omitempty"` + // If true, plain_content is always generated from html_content. If false, plain_content is not altered. + GeneratePlainContent *bool `json:"generate_plain_content,omitempty"` + // The HTML content of the Design. + HtmlContent *string `json:"html_content,omitempty"` + // Plain text content of the Design. + PlainContent *string `json:"plain_content,omitempty"` + // The editor used in the UI. + Editor *Editor1 `json:"editor,omitempty"` + // A Thumbnail preview of the template's html content. + ThumbnailUrl *string `json:"thumbnail_url,omitempty"` +} diff --git a/rest/api/v3/templates/model_update_template_request.go b/rest/api/v3/templates/model_update_template_request.go new file mode 100644 index 00000000..bb110304 --- /dev/null +++ b/rest/api/v3/templates/model_update_template_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Templates API +* The Twilio SendGrid Templates API allows you to create and manage email templates to be delivered with SendGrid's sending APIs. The templates you create will be available using a template ID that is passed to our sending APIs as part of the request. Each template may then have multiple versions associated with it. Whichever version is set as \"active\" at the time of the request will be sent to your recipients. This system allows you to update a single template's look and feel entirely without modifying your requests to our Mail Send API. For example, you could have a single template for welcome emails. That welcome template could then have a version for each season of the year that's themed appropriately and marked as active during the appropriate season. The template ID passed to our sending APIs never needs to change; you can just modify which version is active. This API provides operations to create and manage your templates as well as their versions. Each user can create up to 300 different templates. Templates are specific to accounts and Subusers. Templates created on a parent account will not be accessible from the Subusers' accounts. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateTemplateRequest struct for UpdateTemplateRequest +type UpdateTemplateRequest struct { + // The name of the transactional template. + Name *string `json:"name,omitempty"` +} diff --git a/rest/api/v3/tracking_settings/README.md b/rest/api/v3/tracking_settings/README.md new file mode 100644 index 00000000..c7da454a --- /dev/null +++ b/rest/api/v3/tracking_settings/README.md @@ -0,0 +1,75 @@ +# Go API client for + +The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.489222+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ListClickTrackingSetting* | [**ListClickTrackingSetting**](docs/ListClickTrackingSetting.md#listclicktrackingsetting) | **Get** /v3/tracking_settings/click | Retrieve Click Track Settings +*ListGoogleAnalyticsTrackingSetting* | [**ListGoogleAnalyticsTrackingSetting**](docs/ListGoogleAnalyticsTrackingSetting.md#listgoogleanalyticstrackingsetting) | **Get** /v3/tracking_settings/google_analytics | Retrieve Google Analytics Settings +*ListOpenTrackingSetting* | [**ListOpenTrackingSetting**](docs/ListOpenTrackingSetting.md#listopentrackingsetting) | **Get** /v3/tracking_settings/open | Get Open Tracking Settings +*ListSubscriptionTrackingSetting* | [**ListSubscriptionTrackingSetting**](docs/ListSubscriptionTrackingSetting.md#listsubscriptiontrackingsetting) | **Get** /v3/tracking_settings/subscription | Retrieve Subscription Tracking Settings +*ListTrackingSetting* | [**ListTrackingSetting**](docs/ListTrackingSetting.md#listtrackingsetting) | **Get** /v3/tracking_settings | Retrieve Tracking Settings +*UpdateClickTrackingSetting* | [**UpdateClickTrackingSetting**](docs/UpdateClickTrackingSetting.md#updateclicktrackingsetting) | **Patch** /v3/tracking_settings/click | Update Click Tracking Settings +*UpdateGoogleAnalyticsTrackingSetting* | [**UpdateGoogleAnalyticsTrackingSetting**](docs/UpdateGoogleAnalyticsTrackingSetting.md#updategoogleanalyticstrackingsetting) | **Patch** /v3/tracking_settings/google_analytics | Update Google Analytics Settings +*UpdateOpenTrackingSetting* | [**UpdateOpenTrackingSetting**](docs/UpdateOpenTrackingSetting.md#updateopentrackingsetting) | **Patch** /v3/tracking_settings/open | Update Open Tracking Settings +*UpdateSubscriptionTrackingSetting* | [**UpdateSubscriptionTrackingSetting**](docs/UpdateSubscriptionTrackingSetting.md#updatesubscriptiontrackingsetting) | **Patch** /v3/tracking_settings/subscription | Update Subscription Tracking Settings + + +## Documentation For Models + + - [ClickTracking](ClickTracking.md) + - [GoogleAnalyticsSettings](GoogleAnalyticsSettings.md) + - [ListOpenTrackingSetting200Response](ListOpenTrackingSetting200Response.md) + - [ListTrackingSetting200Response](ListTrackingSetting200Response.md) + - [ListTrackingSetting200ResponseResultInner](ListTrackingSetting200ResponseResultInner.md) + - [SubscriptionTrackingSettings](SubscriptionTrackingSettings.md) + - [UpdateClickTrackingSettingRequest](UpdateClickTrackingSettingRequest.md) + - [UpdateOpenTrackingSettingRequest](UpdateOpenTrackingSettingRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/tracking_settings/api_list_click_tracking_setting.go b/rest/api/v3/tracking_settings/api_list_click_tracking_setting.go new file mode 100644 index 00000000..e9c1c2ce --- /dev/null +++ b/rest/api/v3/tracking_settings/api_list_click_tracking_setting.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListClickTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListClickTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *ListClickTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current click tracking setting.** Click Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/). Click tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email +func (c *ApiService) ListClickTrackingSetting(params *ListClickTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/click" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ClickTracking{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_list_google_analytics_tracking_setting.go b/rest/api/v3/tracking_settings/api_list_google_analytics_tracking_setting.go new file mode 100644 index 00000000..78afc83f --- /dev/null +++ b/rest/api/v3/tracking_settings/api_list_google_analytics_tracking_setting.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListGoogleAnalyticsTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListGoogleAnalyticsTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *ListGoogleAnalyticsTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current setting for Google Analytics.** Google Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on [\"Best Practices for Campaign Building\"](https://support.google.com/analytics/answer/1037445). We default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/). +func (c *ApiService) ListGoogleAnalyticsTrackingSetting(params *ListGoogleAnalyticsTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/google_analytics" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GoogleAnalyticsSettings{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_list_open_tracking_setting.go b/rest/api/v3/tracking_settings/api_list_open_tracking_setting.go new file mode 100644 index 00000000..3d834495 --- /dev/null +++ b/rest/api/v3/tracking_settings/api_list_open_tracking_setting.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListOpenTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListOpenTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *ListOpenTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current settings for open tracking.** Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +func (c *ApiService) ListOpenTrackingSetting(params *ListOpenTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/open" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListOpenTrackingSetting200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_list_subscription_tracking_setting.go b/rest/api/v3/tracking_settings/api_list_subscription_tracking_setting.go new file mode 100644 index 00000000..d540ac73 --- /dev/null +++ b/rest/api/v3/tracking_settings/api_list_subscription_tracking_setting.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListSubscriptionTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListSubscriptionTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *ListSubscriptionTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current settings for subscription tracking.** Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +func (c *ApiService) ListSubscriptionTrackingSetting(params *ListSubscriptionTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/subscription" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubscriptionTrackingSettings{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_list_tracking_setting.go b/rest/api/v3/tracking_settings/api_list_tracking_setting.go new file mode 100644 index 00000000..64b13c74 --- /dev/null +++ b/rest/api/v3/tracking_settings/api_list_tracking_setting.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *ListTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a list of all tracking settings on your account.** +func (c *ApiService) ListTrackingSetting(params *ListTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListTrackingSetting200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_service.go b/rest/api/v3/tracking_settings/api_service.go new file mode 100644 index 00000000..66f5e1d2 --- /dev/null +++ b/rest/api/v3/tracking_settings/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/tracking_settings/api_update_click_tracking_setting.go b/rest/api/v3/tracking_settings/api_update_click_tracking_setting.go new file mode 100644 index 00000000..06bd79ff --- /dev/null +++ b/rest/api/v3/tracking_settings/api_update_click_tracking_setting.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateClickTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateClickTrackingSettingRequest *UpdateClickTrackingSettingRequest `json:"UpdateClickTrackingSettingRequest,omitempty"` +} + +func (params *UpdateClickTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *UpdateClickTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateClickTrackingSettingParam) SetUpdateClickTrackingSettingRequest(UpdateClickTrackingSettingRequest UpdateClickTrackingSettingRequest) *UpdateClickTrackingSettingParam { + params.UpdateClickTrackingSettingRequest = &UpdateClickTrackingSettingRequest + return params +} + +// **This endpoint allows you to enable or disable your current click tracking setting.** Click Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/). Click tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email +func (c *ApiService) UpdateClickTrackingSetting(params *UpdateClickTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/click" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateClickTrackingSettingRequest != nil { + b, err := json.Marshal(*params.UpdateClickTrackingSettingRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ClickTracking{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_update_google_analytics_tracking_setting.go b/rest/api/v3/tracking_settings/api_update_google_analytics_tracking_setting.go new file mode 100644 index 00000000..c0e4e45c --- /dev/null +++ b/rest/api/v3/tracking_settings/api_update_google_analytics_tracking_setting.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateGoogleAnalyticsTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + GoogleAnalyticsSettings *GoogleAnalyticsSettings `json:"GoogleAnalyticsSettings,omitempty"` +} + +func (params *UpdateGoogleAnalyticsTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *UpdateGoogleAnalyticsTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateGoogleAnalyticsTrackingSettingParam) SetGoogleAnalyticsSettings(GoogleAnalyticsSettings GoogleAnalyticsSettings) *UpdateGoogleAnalyticsTrackingSettingParam { + params.GoogleAnalyticsSettings = &GoogleAnalyticsSettings + return params +} + +// **This endpoint allows you to update your current setting for Google Analytics.** Google Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on [\"Best Practices for Campaign Building\"](https://support.google.com/analytics/answer/1037445). We default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/). +func (c *ApiService) UpdateGoogleAnalyticsTrackingSetting(params *UpdateGoogleAnalyticsTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/google_analytics" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.GoogleAnalyticsSettings != nil { + b, err := json.Marshal(*params.GoogleAnalyticsSettings) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GoogleAnalyticsSettings{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_update_open_tracking_setting.go b/rest/api/v3/tracking_settings/api_update_open_tracking_setting.go new file mode 100644 index 00000000..3d634c20 --- /dev/null +++ b/rest/api/v3/tracking_settings/api_update_open_tracking_setting.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateOpenTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateOpenTrackingSettingRequest *UpdateOpenTrackingSettingRequest `json:"UpdateOpenTrackingSettingRequest,omitempty"` +} + +func (params *UpdateOpenTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *UpdateOpenTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateOpenTrackingSettingParam) SetUpdateOpenTrackingSettingRequest(UpdateOpenTrackingSettingRequest UpdateOpenTrackingSettingRequest) *UpdateOpenTrackingSettingParam { + params.UpdateOpenTrackingSettingRequest = &UpdateOpenTrackingSettingRequest + return params +} + +// **This endpoint allows you to update your current settings for open tracking.** Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +func (c *ApiService) UpdateOpenTrackingSetting(params *UpdateOpenTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/open" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateOpenTrackingSettingRequest != nil { + b, err := json.Marshal(*params.UpdateOpenTrackingSettingRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListOpenTrackingSetting200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/api_update_subscription_tracking_setting.go b/rest/api/v3/tracking_settings/api_update_subscription_tracking_setting.go new file mode 100644 index 00000000..899c7ef0 --- /dev/null +++ b/rest/api/v3/tracking_settings/api_update_subscription_tracking_setting.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateSubscriptionTrackingSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + SubscriptionTrackingSettings *SubscriptionTrackingSettings `json:"SubscriptionTrackingSettings,omitempty"` +} + +func (params *UpdateSubscriptionTrackingSettingParam) SetOnbehalfof(Onbehalfof string) *UpdateSubscriptionTrackingSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateSubscriptionTrackingSettingParam) SetSubscriptionTrackingSettings(SubscriptionTrackingSettings SubscriptionTrackingSettings) *UpdateSubscriptionTrackingSettingParam { + params.SubscriptionTrackingSettings = &SubscriptionTrackingSettings + return params +} + +// **This endpoint allows you to update your current settings for subscription tracking.** Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. +func (c *ApiService) UpdateSubscriptionTrackingSetting(params *UpdateSubscriptionTrackingSettingParam) (interface{}, error) { + path := "/v3/tracking_settings/subscription" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.SubscriptionTrackingSettings != nil { + b, err := json.Marshal(*params.SubscriptionTrackingSettings) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &SubscriptionTrackingSettings{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/tracking_settings/docs/ClickTracking.md b/rest/api/v3/tracking_settings/docs/ClickTracking.md new file mode 100644 index 00000000..1ed22ee2 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ClickTracking.md @@ -0,0 +1,12 @@ +# ClickTracking + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnableText** | **bool** | Indicates if click tracking is enabled for plain text emails. | +**Enabled** | **bool** | Indicates if click tracking is enabled or disabled. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/GoogleAnalyticsSettings.md b/rest/api/v3/tracking_settings/docs/GoogleAnalyticsSettings.md new file mode 100644 index 00000000..e55f7b45 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/GoogleAnalyticsSettings.md @@ -0,0 +1,16 @@ +# GoogleAnalyticsSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if Google Analytics is enabled. |[optional] +**UtmCampaign** | **string** | The name of the campaign. |[optional] +**UtmContent** | **string** | Used to differentiate ads |[optional] +**UtmMedium** | **string** | Name of the marketing medium (e.g. \"Email\"). |[optional] +**UtmSource** | **string** | Name of the referrer source. |[optional] +**UtmTerm** | **string** | Any paid keywords. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/ListClickTrackingSetting.md b/rest/api/v3/tracking_settings/docs/ListClickTrackingSetting.md new file mode 100644 index 00000000..2437d770 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListClickTrackingSetting.md @@ -0,0 +1,48 @@ +# ListClickTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListClickTrackingSetting**](ListClickTrackingSetting.md#ListClickTrackingSetting) | **Get** /v3/tracking_settings/click | Retrieve Click Track Settings + + + +## ListClickTrackingSetting + +> ClickTracking ListClickTrackingSetting(ctx, optional) + +Retrieve Click Track Settings + +**This endpoint allows you to retrieve your current click tracking setting.** Click Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/). Click tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListClickTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ClickTracking**](ClickTracking.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/ListGoogleAnalyticsTrackingSetting.md b/rest/api/v3/tracking_settings/docs/ListGoogleAnalyticsTrackingSetting.md new file mode 100644 index 00000000..fdb71673 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListGoogleAnalyticsTrackingSetting.md @@ -0,0 +1,48 @@ +# ListGoogleAnalyticsTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListGoogleAnalyticsTrackingSetting**](ListGoogleAnalyticsTrackingSetting.md#ListGoogleAnalyticsTrackingSetting) | **Get** /v3/tracking_settings/google_analytics | Retrieve Google Analytics Settings + + + +## ListGoogleAnalyticsTrackingSetting + +> GoogleAnalyticsSettings ListGoogleAnalyticsTrackingSetting(ctx, optional) + +Retrieve Google Analytics Settings + +**This endpoint allows you to retrieve your current setting for Google Analytics.** Google Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on [\"Best Practices for Campaign Building\"](https://support.google.com/analytics/answer/1037445). We default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListGoogleAnalyticsTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GoogleAnalyticsSettings**](GoogleAnalyticsSettings.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting.md b/rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting.md new file mode 100644 index 00000000..958867f9 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting.md @@ -0,0 +1,48 @@ +# ListOpenTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListOpenTrackingSetting**](ListOpenTrackingSetting.md#ListOpenTrackingSetting) | **Get** /v3/tracking_settings/open | Get Open Tracking Settings + + + +## ListOpenTrackingSetting + +> ListOpenTrackingSetting200Response ListOpenTrackingSetting(ctx, optional) + +Get Open Tracking Settings + +**This endpoint allows you to retrieve your current settings for open tracking.** Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListOpenTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListOpenTrackingSetting200Response**](ListOpenTrackingSetting200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting200Response.md b/rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting200Response.md new file mode 100644 index 00000000..3a4a7db5 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListOpenTrackingSetting200Response.md @@ -0,0 +1,11 @@ +# ListOpenTrackingSetting200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if open tracking is enabled. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/ListSubscriptionTrackingSetting.md b/rest/api/v3/tracking_settings/docs/ListSubscriptionTrackingSetting.md new file mode 100644 index 00000000..12d9be73 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListSubscriptionTrackingSetting.md @@ -0,0 +1,48 @@ +# ListSubscriptionTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListSubscriptionTrackingSetting**](ListSubscriptionTrackingSetting.md#ListSubscriptionTrackingSetting) | **Get** /v3/tracking_settings/subscription | Retrieve Subscription Tracking Settings + + + +## ListSubscriptionTrackingSetting + +> SubscriptionTrackingSettings ListSubscriptionTrackingSetting(ctx, optional) + +Retrieve Subscription Tracking Settings + +**This endpoint allows you to retrieve your current settings for subscription tracking.** Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListSubscriptionTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**SubscriptionTrackingSettings**](SubscriptionTrackingSettings.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/ListTrackingSetting.md b/rest/api/v3/tracking_settings/docs/ListTrackingSetting.md new file mode 100644 index 00000000..24b3b155 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListTrackingSetting.md @@ -0,0 +1,48 @@ +# ListTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListTrackingSetting**](ListTrackingSetting.md#ListTrackingSetting) | **Get** /v3/tracking_settings | Retrieve Tracking Settings + + + +## ListTrackingSetting + +> ListTrackingSetting200Response ListTrackingSetting(ctx, optional) + +Retrieve Tracking Settings + +**This endpoint allows you to retrieve a list of all tracking settings on your account.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListTrackingSetting200Response**](ListTrackingSetting200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/ListTrackingSetting200Response.md b/rest/api/v3/tracking_settings/docs/ListTrackingSetting200Response.md new file mode 100644 index 00000000..9e49cf92 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListTrackingSetting200Response.md @@ -0,0 +1,11 @@ +# ListTrackingSetting200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ListTrackingSetting200ResponseResultInner**](ListTrackingSetting200ResponseResultInner.md) | The list of all tracking settings. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/ListTrackingSetting200ResponseResultInner.md b/rest/api/v3/tracking_settings/docs/ListTrackingSetting200ResponseResultInner.md new file mode 100644 index 00000000..de2cbab9 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/ListTrackingSetting200ResponseResultInner.md @@ -0,0 +1,14 @@ +# ListTrackingSetting200ResponseResultInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the event being tracked. |[optional] +**Title** | **string** | The title of the tracking setting. |[optional] +**Description** | **string** | A description about the event that is being tracked. |[optional] +**Enabled** | **bool** | Indicates if this tracking setting is currently enabled. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/SubscriptionTrackingSettings.md b/rest/api/v3/tracking_settings/docs/SubscriptionTrackingSettings.md new file mode 100644 index 00000000..2d7ac4bb --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/SubscriptionTrackingSettings.md @@ -0,0 +1,16 @@ +# SubscriptionTrackingSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if subscription tracking is enabled. |[optional] +**HtmlContent** | **string** | The information and HTML for your unsubscribe link. |[optional] +**Landing** | **string** | The HTML that will be displayed on the page that your customers will see after clicking unsubscribe, hosted on SendGrid’s server. |[optional] +**PlainContent** | **string** | The information in plain text for your unsubscribe link. You should have the “<% %>” tag in your content, otherwise the user will have no URL for unsubscribing. |[optional] +**Replace** | **string** | Your custom defined replacement tag for your templates. Use this tag to place your unsubscribe content anywhere in your emailtemplate. |[optional] +**Url** | **string** | The URL where you would like your users sent to unsubscribe. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/UpdateClickTrackingSetting.md b/rest/api/v3/tracking_settings/docs/UpdateClickTrackingSetting.md new file mode 100644 index 00000000..78a5a4e5 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/UpdateClickTrackingSetting.md @@ -0,0 +1,49 @@ +# UpdateClickTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateClickTrackingSetting**](UpdateClickTrackingSetting.md#UpdateClickTrackingSetting) | **Patch** /v3/tracking_settings/click | Update Click Tracking Settings + + + +## UpdateClickTrackingSetting + +> ClickTracking UpdateClickTrackingSetting(ctx, optional) + +Update Click Tracking Settings + +**This endpoint allows you to enable or disable your current click tracking setting.** Click Tracking overrides all the links and URLs in your emails and points them to either SendGrid’s servers or the domain with which you branded your link. When a customer clicks a link, SendGrid tracks those [clicks](https://sendgrid.com/docs/glossary/clicks/). Click tracking helps you understand how users are engaging with your communications. SendGrid can track up to 1000 links per email + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateClickTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateClickTrackingSettingRequest** | [**UpdateClickTrackingSettingRequest**](UpdateClickTrackingSettingRequest.md) | + +### Return type + +[**ClickTracking**](ClickTracking.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/UpdateClickTrackingSettingRequest.md b/rest/api/v3/tracking_settings/docs/UpdateClickTrackingSettingRequest.md new file mode 100644 index 00000000..61b2c708 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/UpdateClickTrackingSettingRequest.md @@ -0,0 +1,11 @@ +# UpdateClickTrackingSettingRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | The setting you want to use for click tracking. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/UpdateGoogleAnalyticsTrackingSetting.md b/rest/api/v3/tracking_settings/docs/UpdateGoogleAnalyticsTrackingSetting.md new file mode 100644 index 00000000..d3310250 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/UpdateGoogleAnalyticsTrackingSetting.md @@ -0,0 +1,49 @@ +# UpdateGoogleAnalyticsTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateGoogleAnalyticsTrackingSetting**](UpdateGoogleAnalyticsTrackingSetting.md#UpdateGoogleAnalyticsTrackingSetting) | **Patch** /v3/tracking_settings/google_analytics | Update Google Analytics Settings + + + +## UpdateGoogleAnalyticsTrackingSetting + +> GoogleAnalyticsSettings UpdateGoogleAnalyticsTrackingSetting(ctx, optional) + +Update Google Analytics Settings + +**This endpoint allows you to update your current setting for Google Analytics.** Google Analytics helps you understand how users got to your site and what they're doing there. For more information about using Google Analytics, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on [\"Best Practices for Campaign Building\"](https://support.google.com/analytics/answer/1037445). We default the settings to Google’s recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/ui/analytics-and-reporting/google-analytics/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateGoogleAnalyticsTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**GoogleAnalyticsSettings** | [**GoogleAnalyticsSettings**](GoogleAnalyticsSettings.md) | + +### Return type + +[**GoogleAnalyticsSettings**](GoogleAnalyticsSettings.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSetting.md b/rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSetting.md new file mode 100644 index 00000000..8e05d80f --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSetting.md @@ -0,0 +1,49 @@ +# UpdateOpenTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateOpenTrackingSetting**](UpdateOpenTrackingSetting.md#UpdateOpenTrackingSetting) | **Patch** /v3/tracking_settings/open | Update Open Tracking Settings + + + +## UpdateOpenTrackingSetting + +> ListOpenTrackingSetting200Response UpdateOpenTrackingSetting(ctx, optional) + +Update Open Tracking Settings + +**This endpoint allows you to update your current settings for open tracking.** Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrid’s server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateOpenTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateOpenTrackingSettingRequest** | [**UpdateOpenTrackingSettingRequest**](UpdateOpenTrackingSettingRequest.md) | + +### Return type + +[**ListOpenTrackingSetting200Response**](ListOpenTrackingSetting200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSettingRequest.md b/rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSettingRequest.md new file mode 100644 index 00000000..0b5d7d38 --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/UpdateOpenTrackingSettingRequest.md @@ -0,0 +1,11 @@ +# UpdateOpenTrackingSettingRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | The new status that you want to set for open tracking. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/tracking_settings/docs/UpdateSubscriptionTrackingSetting.md b/rest/api/v3/tracking_settings/docs/UpdateSubscriptionTrackingSetting.md new file mode 100644 index 00000000..627a0d9f --- /dev/null +++ b/rest/api/v3/tracking_settings/docs/UpdateSubscriptionTrackingSetting.md @@ -0,0 +1,49 @@ +# UpdateSubscriptionTrackingSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSubscriptionTrackingSetting**](UpdateSubscriptionTrackingSetting.md#UpdateSubscriptionTrackingSetting) | **Patch** /v3/tracking_settings/subscription | Update Subscription Tracking Settings + + + +## UpdateSubscriptionTrackingSetting + +> SubscriptionTrackingSettings UpdateSubscriptionTrackingSetting(ctx, optional) + +Update Subscription Tracking Settings + +**This endpoint allows you to update your current settings for subscription tracking.** Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSubscriptionTrackingSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**SubscriptionTrackingSettings** | [**SubscriptionTrackingSettings**](SubscriptionTrackingSettings.md) | + +### Return type + +[**SubscriptionTrackingSettings**](SubscriptionTrackingSettings.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/tracking_settings/model_click_tracking.go b/rest/api/v3/tracking_settings/model_click_tracking.go new file mode 100644 index 00000000..6f9e6da9 --- /dev/null +++ b/rest/api/v3/tracking_settings/model_click_tracking.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ClickTracking struct for ClickTracking +type ClickTracking struct { + // Indicates if click tracking is enabled for plain text emails. + EnableText bool `json:"enable_text"` + // Indicates if click tracking is enabled or disabled. + Enabled bool `json:"enabled"` +} diff --git a/rest/api/v3/tracking_settings/model_google_analytics_settings.go b/rest/api/v3/tracking_settings/model_google_analytics_settings.go new file mode 100644 index 00000000..26e187e8 --- /dev/null +++ b/rest/api/v3/tracking_settings/model_google_analytics_settings.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GoogleAnalyticsSettings struct for GoogleAnalyticsSettings +type GoogleAnalyticsSettings struct { + // Indicates if Google Analytics is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The name of the campaign. + UtmCampaign *string `json:"utm_campaign,omitempty"` + // Used to differentiate ads + UtmContent *string `json:"utm_content,omitempty"` + // Name of the marketing medium (e.g. \"Email\"). + UtmMedium *string `json:"utm_medium,omitempty"` + // Name of the referrer source. + UtmSource *string `json:"utm_source,omitempty"` + // Any paid keywords. + UtmTerm *string `json:"utm_term,omitempty"` +} diff --git a/rest/api/v3/tracking_settings/model_list_open_tracking_setting_200_response.go b/rest/api/v3/tracking_settings/model_list_open_tracking_setting_200_response.go new file mode 100644 index 00000000..84973abc --- /dev/null +++ b/rest/api/v3/tracking_settings/model_list_open_tracking_setting_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListOpenTrackingSetting200Response struct for ListOpenTrackingSetting200Response +type ListOpenTrackingSetting200Response struct { + // Indicates if open tracking is enabled. + Enabled bool `json:"enabled"` +} diff --git a/rest/api/v3/tracking_settings/model_list_tracking_setting_200_response.go b/rest/api/v3/tracking_settings/model_list_tracking_setting_200_response.go new file mode 100644 index 00000000..92bad2b6 --- /dev/null +++ b/rest/api/v3/tracking_settings/model_list_tracking_setting_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListTrackingSetting200Response struct for ListTrackingSetting200Response +type ListTrackingSetting200Response struct { + // The list of all tracking settings. + Result *[]ListTrackingSetting200ResponseResultInner `json:"result,omitempty"` +} diff --git a/rest/api/v3/tracking_settings/model_list_tracking_setting_200_response_result_inner.go b/rest/api/v3/tracking_settings/model_list_tracking_setting_200_response_result_inner.go new file mode 100644 index 00000000..849d497a --- /dev/null +++ b/rest/api/v3/tracking_settings/model_list_tracking_setting_200_response_result_inner.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListTrackingSetting200ResponseResultInner struct for ListTrackingSetting200ResponseResultInner +type ListTrackingSetting200ResponseResultInner struct { + // The name of the event being tracked. + Name *string `json:"name,omitempty"` + // The title of the tracking setting. + Title *string `json:"title,omitempty"` + // A description about the event that is being tracked. + Description *string `json:"description,omitempty"` + // Indicates if this tracking setting is currently enabled. + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/rest/api/v3/tracking_settings/model_subscription_tracking_settings.go b/rest/api/v3/tracking_settings/model_subscription_tracking_settings.go new file mode 100644 index 00000000..ba674b35 --- /dev/null +++ b/rest/api/v3/tracking_settings/model_subscription_tracking_settings.go @@ -0,0 +1,30 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// SubscriptionTrackingSettings struct for SubscriptionTrackingSettings +type SubscriptionTrackingSettings struct { + // Indicates if subscription tracking is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The information and HTML for your unsubscribe link. + HtmlContent *string `json:"html_content,omitempty"` + // The HTML that will be displayed on the page that your customers will see after clicking unsubscribe, hosted on SendGrid’s server. + Landing *string `json:"landing,omitempty"` + // The information in plain text for your unsubscribe link. You should have the “<% %>” tag in your content, otherwise the user will have no URL for unsubscribing. + PlainContent *string `json:"plain_content,omitempty"` + // Your custom defined replacement tag for your templates. Use this tag to place your unsubscribe content anywhere in your emailtemplate. + Replace *string `json:"replace,omitempty"` + // The URL where you would like your users sent to unsubscribe. + Url *string `json:"url,omitempty"` +} diff --git a/rest/api/v3/tracking_settings/model_update_click_tracking_setting_request.go b/rest/api/v3/tracking_settings/model_update_click_tracking_setting_request.go new file mode 100644 index 00000000..b94df6e7 --- /dev/null +++ b/rest/api/v3/tracking_settings/model_update_click_tracking_setting_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateClickTrackingSettingRequest struct for UpdateClickTrackingSettingRequest +type UpdateClickTrackingSettingRequest struct { + // The setting you want to use for click tracking. + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/rest/api/v3/tracking_settings/model_update_open_tracking_setting_request.go b/rest/api/v3/tracking_settings/model_update_open_tracking_setting_request.go new file mode 100644 index 00000000..b1c1b301 --- /dev/null +++ b/rest/api/v3/tracking_settings/model_update_open_tracking_setting_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Tracking Settings API +* The Twilio SendGrid Tracking Settings API allows you to configure which tracking settings are enabled for your messages. You can track many of your recipients' interactions with your emails, including which emails they open, which links they click, and when they subscribe to or unsubscribe from your emails. See [**Tracking Settings**](https://docs.sendgrid.com/ui/account-and-settings/tracking) for more information. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateOpenTrackingSettingRequest struct for UpdateOpenTrackingSettingRequest +type UpdateOpenTrackingSettingRequest struct { + // The new status that you want to set for open tracking. + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/rest/api/v3/user/README.md b/rest/api/v3/user/README.md new file mode 100644 index 00000000..c97dd8f9 --- /dev/null +++ b/rest/api/v3/user/README.md @@ -0,0 +1,83 @@ +# Go API client for + +The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. + +See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.512612+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ListAccount* | [**ListAccount**](docs/ListAccount.md#listaccount) | **Get** /v3/user/account | Get a user's account information. +*ListCredit* | [**ListCredit**](docs/ListCredit.md#listcredit) | **Get** /v3/user/credits | Retrieve your credit balance +*ListEmail* | [**ListEmail**](docs/ListEmail.md#listemail) | **Get** /v3/user/email | Retrieve your account email address +*ListProfile* | [**ListProfile**](docs/ListProfile.md#listprofile) | **Get** /v3/user/profile | Get a user's profile +*ListUsername* | [**ListUsername**](docs/ListUsername.md#listusername) | **Get** /v3/user/username | Retrieve your username +*UpdateEmail* | [**UpdateEmail**](docs/UpdateEmail.md#updateemail) | **Put** /v3/user/email | Update your account email address +*UpdatePassword* | [**UpdatePassword**](docs/UpdatePassword.md#updatepassword) | **Put** /v3/user/password | Update your password +*UpdateProfile* | [**UpdateProfile**](docs/UpdateProfile.md#updateprofile) | **Patch** /v3/user/profile | Update a user's profile +*UpdateUsername* | [**UpdateUsername**](docs/UpdateUsername.md#updateusername) | **Put** /v3/user/username | Update your username + + +## Documentation For Models + + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [GETUserAccountResponse](GETUserAccountResponse.md) + - [GETUserProfileResponse](GETUserProfileResponse.md) + - [ListCredit200Response](ListCredit200Response.md) + - [ListEmail200Response](ListEmail200Response.md) + - [ListUsername200Response](ListUsername200Response.md) + - [Type](Type.md) + - [UpdateEmail200Response](UpdateEmail200Response.md) + - [UpdateEmailRequest](UpdateEmailRequest.md) + - [UpdatePasswordRequest](UpdatePasswordRequest.md) + - [UpdateUsername200Response](UpdateUsername200Response.md) + - [UpdateUsernameRequest](UpdateUsernameRequest.md) + - [UserProfile](UserProfile.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/user/api_list_account.go b/rest/api/v3/user/api_list_account.go new file mode 100644 index 00000000..42434726 --- /dev/null +++ b/rest/api/v3/user/api_list_account.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListAccountParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListAccountParam) SetOnbehalfof(Onbehalfof string) *ListAccountParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your user account details.** Your user's account information includes the user's account type and reputation. +func (c *ApiService) ListAccount(params *ListAccountParam) (interface{}, error) { + path := "/v3/user/account" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GETUserAccountResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_list_credit.go b/rest/api/v3/user/api_list_credit.go new file mode 100644 index 00000000..7e9d122b --- /dev/null +++ b/rest/api/v3/user/api_list_credit.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListCreditParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListCreditParam) SetOnbehalfof(Onbehalfof string) *ListCreditParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the current credit balance for your account.** Each account has a credit balance, which is a base number of emails it can send before receiving per-email charges. For more information about credits and billing, see [Billing and Plan details information](https://sendgrid.com/docs/ui/account-and-settings/billing/). +func (c *ApiService) ListCredit(params *ListCreditParam) (interface{}, error) { + path := "/v3/user/credits" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListCredit200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_list_email.go b/rest/api/v3/user/api_list_email.go new file mode 100644 index 00000000..a1f5ef16 --- /dev/null +++ b/rest/api/v3/user/api_list_email.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListEmailParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListEmailParam) SetOnbehalfof(Onbehalfof string) *ListEmailParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the email address currently on file for your account.** +func (c *ApiService) ListEmail(params *ListEmailParam) (interface{}, error) { + path := "/v3/user/email" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListEmail200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_list_profile.go b/rest/api/v3/user/api_list_profile.go new file mode 100644 index 00000000..a63187f2 --- /dev/null +++ b/rest/api/v3/user/api_list_profile.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListProfileParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListProfileParam) SetOnbehalfof(Onbehalfof string) *ListProfileParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current profile details.** +func (c *ApiService) ListProfile(params *ListProfileParam) (interface{}, error) { + path := "/v3/user/profile" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GETUserProfileResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_list_username.go b/rest/api/v3/user/api_list_username.go new file mode 100644 index 00000000..7b375167 --- /dev/null +++ b/rest/api/v3/user/api_list_username.go @@ -0,0 +1,59 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListUsernameParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListUsernameParam) SetOnbehalfof(Onbehalfof string) *ListUsernameParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve your current account username.** +func (c *ApiService) ListUsername(params *ListUsernameParam) (interface{}, error) { + path := "/v3/user/username" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListUsername200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_service.go b/rest/api/v3/user/api_service.go new file mode 100644 index 00000000..67bbc6b4 --- /dev/null +++ b/rest/api/v3/user/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/user/api_update_email.go b/rest/api/v3/user/api_update_email.go new file mode 100644 index 00000000..6a2f6867 --- /dev/null +++ b/rest/api/v3/user/api_update_email.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateEmailParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateEmailRequest *UpdateEmailRequest `json:"UpdateEmailRequest,omitempty"` +} + +func (params *UpdateEmailParam) SetOnbehalfof(Onbehalfof string) *UpdateEmailParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateEmailParam) SetUpdateEmailRequest(UpdateEmailRequest UpdateEmailRequest) *UpdateEmailParam { + params.UpdateEmailRequest = &UpdateEmailRequest + return params +} + +// **This endpoint allows you to update the email address currently on file for your account.** +func (c *ApiService) UpdateEmail(params *UpdateEmailParam) (interface{}, error) { + path := "/v3/user/email" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateEmailRequest != nil { + b, err := json.Marshal(*params.UpdateEmailRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateEmail200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_update_password.go b/rest/api/v3/user/api_update_password.go new file mode 100644 index 00000000..bb22ffae --- /dev/null +++ b/rest/api/v3/user/api_update_password.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdatePasswordParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdatePasswordRequest *UpdatePasswordRequest `json:"UpdatePasswordRequest,omitempty"` +} + +func (params *UpdatePasswordParam) SetOnbehalfof(Onbehalfof string) *UpdatePasswordParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdatePasswordParam) SetUpdatePasswordRequest(UpdatePasswordRequest UpdatePasswordRequest) *UpdatePasswordParam { + params.UpdatePasswordRequest = &UpdatePasswordRequest + return params +} + +// **This endpoint allows you to update your password.** +func (c *ApiService) UpdatePassword(params *UpdatePasswordParam) (interface{}, error) { + path := "/v3/user/password" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdatePasswordRequest != nil { + b, err := json.Marshal(*params.UpdatePasswordRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_update_profile.go b/rest/api/v3/user/api_update_profile.go new file mode 100644 index 00000000..834287f3 --- /dev/null +++ b/rest/api/v3/user/api_update_profile.go @@ -0,0 +1,82 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateProfileParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UserProfile *UserProfile `json:"UserProfile,omitempty"` +} + +func (params *UpdateProfileParam) SetOnbehalfof(Onbehalfof string) *UpdateProfileParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateProfileParam) SetUserProfile(UserProfile UserProfile) *UpdateProfileParam { + params.UserProfile = &UserProfile + return params +} + +// **This endpoint allows you to update your current profile details.** Any one or more of the parameters can be updated via the PATCH `/user/profile` endpoint. You must include at least one when you PATCH. +func (c *ApiService) UpdateProfile(params *UpdateProfileParam) (interface{}, error) { + path := "/v3/user/profile" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UserProfile != nil { + b, err := json.Marshal(*params.UserProfile) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UserProfile{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/api_update_username.go b/rest/api/v3/user/api_update_username.go new file mode 100644 index 00000000..61335518 --- /dev/null +++ b/rest/api/v3/user/api_update_username.go @@ -0,0 +1,74 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type UpdateUsernameParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateUsernameRequest *UpdateUsernameRequest `json:"UpdateUsernameRequest,omitempty"` +} + +func (params *UpdateUsernameParam) SetOnbehalfof(Onbehalfof string) *UpdateUsernameParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateUsernameParam) SetUpdateUsernameRequest(UpdateUsernameRequest UpdateUsernameRequest) *UpdateUsernameParam { + params.UpdateUsernameRequest = &UpdateUsernameRequest + return params +} + +// **This endpoint allows you to update the username for your account.** +func (c *ApiService) UpdateUsername(params *UpdateUsernameParam) (interface{}, error) { + path := "/v3/user/username" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateUsernameRequest != nil { + b, err := json.Marshal(*params.UpdateUsernameRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Put(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &UpdateUsername200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/user/docs/ErrorResponse.md b/rest/api/v3/user/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/user/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/ErrorResponseErrorsInner.md b/rest/api/v3/user/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/user/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/GETUserAccountResponse.md b/rest/api/v3/user/docs/GETUserAccountResponse.md new file mode 100644 index 00000000..3c2144b8 --- /dev/null +++ b/rest/api/v3/user/docs/GETUserAccountResponse.md @@ -0,0 +1,12 @@ +# GETUserAccountResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**Type**](Type.md) | The type of account for this user. | +**Reputation** | **float32** | The sender reputation for this user. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/GETUserProfileResponse.md b/rest/api/v3/user/docs/GETUserProfileResponse.md new file mode 100644 index 00000000..37a24d1d --- /dev/null +++ b/rest/api/v3/user/docs/GETUserProfileResponse.md @@ -0,0 +1,21 @@ +# GETUserProfileResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | The user's address. | +**Address2** | **string** | The second line of the user's address. |[optional] +**City** | **string** | The user's city. | +**Company** | **string** | The name of the user's company. | +**Country** | **string** | The user's country. | +**FirstName** | **string** | The user's first name. | +**LastName** | **string** | The user's last name. | +**Phone** | **string** | The user's phone number. | +**State** | **string** | The user's state. | +**Website** | **string** | The user's website URL. | +**Zip** | **string** | The user's zip code. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/ListAccount.md b/rest/api/v3/user/docs/ListAccount.md new file mode 100644 index 00000000..ca5f15ad --- /dev/null +++ b/rest/api/v3/user/docs/ListAccount.md @@ -0,0 +1,48 @@ +# ListAccount + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListAccount**](ListAccount.md#ListAccount) | **Get** /v3/user/account | Get a user's account information. + + + +## ListAccount + +> GETUserAccountResponse ListAccount(ctx, optional) + +Get a user's account information. + +**This endpoint allows you to retrieve your user account details.** Your user's account information includes the user's account type and reputation. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListAccountParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GETUserAccountResponse**](GETUserAccountResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/ListCredit.md b/rest/api/v3/user/docs/ListCredit.md new file mode 100644 index 00000000..48078ae9 --- /dev/null +++ b/rest/api/v3/user/docs/ListCredit.md @@ -0,0 +1,48 @@ +# ListCredit + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCredit**](ListCredit.md#ListCredit) | **Get** /v3/user/credits | Retrieve your credit balance + + + +## ListCredit + +> ListCredit200Response ListCredit(ctx, optional) + +Retrieve your credit balance + +**This endpoint allows you to retrieve the current credit balance for your account.** Each account has a credit balance, which is a base number of emails it can send before receiving per-email charges. For more information about credits and billing, see [Billing and Plan details information](https://sendgrid.com/docs/ui/account-and-settings/billing/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListCreditParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListCredit200Response**](ListCredit200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/ListCredit200Response.md b/rest/api/v3/user/docs/ListCredit200Response.md new file mode 100644 index 00000000..9a650e21 --- /dev/null +++ b/rest/api/v3/user/docs/ListCredit200Response.md @@ -0,0 +1,17 @@ +# ListCredit200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Remain** | **int32** | The remaining number of credits available on your account. | +**Total** | **int32** | The total number of credits assigned to your account. | +**Overage** | **int32** | The number of overdrawn credits for your account. | +**Used** | **int32** | The number of credits that you have used. | +**LastReset** | **string** | The date that your credit balance was last reset. | +**NextReset** | **string** | The next date that your credit balance will be reset. | +**ResetFrequency** | **string** | The frequency at which your credit balance will be reset. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/ListEmail.md b/rest/api/v3/user/docs/ListEmail.md new file mode 100644 index 00000000..aa5614c1 --- /dev/null +++ b/rest/api/v3/user/docs/ListEmail.md @@ -0,0 +1,48 @@ +# ListEmail + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListEmail**](ListEmail.md#ListEmail) | **Get** /v3/user/email | Retrieve your account email address + + + +## ListEmail + +> ListEmail200Response ListEmail(ctx, optional) + +Retrieve your account email address + +**This endpoint allows you to retrieve the email address currently on file for your account.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListEmailParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListEmail200Response**](ListEmail200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/ListEmail200Response.md b/rest/api/v3/user/docs/ListEmail200Response.md new file mode 100644 index 00000000..a7387a81 --- /dev/null +++ b/rest/api/v3/user/docs/ListEmail200Response.md @@ -0,0 +1,11 @@ +# ListEmail200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The email address currently on file for your account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/ListProfile.md b/rest/api/v3/user/docs/ListProfile.md new file mode 100644 index 00000000..d41f9b32 --- /dev/null +++ b/rest/api/v3/user/docs/ListProfile.md @@ -0,0 +1,48 @@ +# ListProfile + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListProfile**](ListProfile.md#ListProfile) | **Get** /v3/user/profile | Get a user's profile + + + +## ListProfile + +> GETUserProfileResponse ListProfile(ctx, optional) + +Get a user's profile + +**This endpoint allows you to retrieve your current profile details.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListProfileParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GETUserProfileResponse**](GETUserProfileResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/ListUsername.md b/rest/api/v3/user/docs/ListUsername.md new file mode 100644 index 00000000..e9f91d80 --- /dev/null +++ b/rest/api/v3/user/docs/ListUsername.md @@ -0,0 +1,48 @@ +# ListUsername + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListUsername**](ListUsername.md#ListUsername) | **Get** /v3/user/username | Retrieve your username + + + +## ListUsername + +> ListUsername200Response ListUsername(ctx, optional) + +Retrieve your username + +**This endpoint allows you to retrieve your current account username.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListUsernameParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListUsername200Response**](ListUsername200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/ListUsername200Response.md b/rest/api/v3/user/docs/ListUsername200Response.md new file mode 100644 index 00000000..c1d23200 --- /dev/null +++ b/rest/api/v3/user/docs/ListUsername200Response.md @@ -0,0 +1,12 @@ +# ListUsername200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | Your account username. | +**UserId** | **int32** | The user ID for your account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/Type.md b/rest/api/v3/user/docs/Type.md new file mode 100644 index 00000000..7736c70d --- /dev/null +++ b/rest/api/v3/user/docs/Type.md @@ -0,0 +1,13 @@ +# Type + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**FREE** | string | (value: `"free"`) +**PAID** | string | (value: `"paid"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/UpdateEmail.md b/rest/api/v3/user/docs/UpdateEmail.md new file mode 100644 index 00000000..aa382b8c --- /dev/null +++ b/rest/api/v3/user/docs/UpdateEmail.md @@ -0,0 +1,49 @@ +# UpdateEmail + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateEmail**](UpdateEmail.md#UpdateEmail) | **Put** /v3/user/email | Update your account email address + + + +## UpdateEmail + +> UpdateEmail200Response UpdateEmail(ctx, optional) + +Update your account email address + +**This endpoint allows you to update the email address currently on file for your account.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateEmailParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateEmailRequest** | [**UpdateEmailRequest**](UpdateEmailRequest.md) | + +### Return type + +[**UpdateEmail200Response**](UpdateEmail200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/UpdateEmail200Response.md b/rest/api/v3/user/docs/UpdateEmail200Response.md new file mode 100644 index 00000000..795960c4 --- /dev/null +++ b/rest/api/v3/user/docs/UpdateEmail200Response.md @@ -0,0 +1,11 @@ +# UpdateEmail200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The current email address on file for your account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/UpdateEmailRequest.md b/rest/api/v3/user/docs/UpdateEmailRequest.md new file mode 100644 index 00000000..1cde2463 --- /dev/null +++ b/rest/api/v3/user/docs/UpdateEmailRequest.md @@ -0,0 +1,11 @@ +# UpdateEmailRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | The new email address that you would like to use for your account. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/UpdatePassword.md b/rest/api/v3/user/docs/UpdatePassword.md new file mode 100644 index 00000000..d393707f --- /dev/null +++ b/rest/api/v3/user/docs/UpdatePassword.md @@ -0,0 +1,49 @@ +# UpdatePassword + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdatePassword**](UpdatePassword.md#UpdatePassword) | **Put** /v3/user/password | Update your password + + + +## UpdatePassword + +> map[string]interface{} UpdatePassword(ctx, optional) + +Update your password + +**This endpoint allows you to update your password.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdatePasswordParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdatePasswordRequest** | [**UpdatePasswordRequest**](UpdatePasswordRequest.md) | + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/UpdatePasswordRequest.md b/rest/api/v3/user/docs/UpdatePasswordRequest.md new file mode 100644 index 00000000..a1264921 --- /dev/null +++ b/rest/api/v3/user/docs/UpdatePasswordRequest.md @@ -0,0 +1,12 @@ +# UpdatePasswordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NewPassword** | **string** | The new password you would like to use for your account. | +**OldPassword** | **string** | The old password for your account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/UpdateProfile.md b/rest/api/v3/user/docs/UpdateProfile.md new file mode 100644 index 00000000..b0dc8f42 --- /dev/null +++ b/rest/api/v3/user/docs/UpdateProfile.md @@ -0,0 +1,49 @@ +# UpdateProfile + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateProfile**](UpdateProfile.md#UpdateProfile) | **Patch** /v3/user/profile | Update a user's profile + + + +## UpdateProfile + +> UserProfile UpdateProfile(ctx, optional) + +Update a user's profile + +**This endpoint allows you to update your current profile details.** Any one or more of the parameters can be updated via the PATCH `/user/profile` endpoint. You must include at least one when you PATCH. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateProfileParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UserProfile** | [**UserProfile**](UserProfile.md) | + +### Return type + +[**UserProfile**](UserProfile.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/UpdateUsername.md b/rest/api/v3/user/docs/UpdateUsername.md new file mode 100644 index 00000000..96938ac8 --- /dev/null +++ b/rest/api/v3/user/docs/UpdateUsername.md @@ -0,0 +1,49 @@ +# UpdateUsername + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateUsername**](UpdateUsername.md#UpdateUsername) | **Put** /v3/user/username | Update your username + + + +## UpdateUsername + +> UpdateUsername200Response UpdateUsername(ctx, optional) + +Update your username + +**This endpoint allows you to update the username for your account.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateUsernameParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateUsernameRequest** | [**UpdateUsernameRequest**](UpdateUsernameRequest.md) | + +### Return type + +[**UpdateUsername200Response**](UpdateUsername200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/user/docs/UpdateUsername200Response.md b/rest/api/v3/user/docs/UpdateUsername200Response.md new file mode 100644 index 00000000..07ffae6c --- /dev/null +++ b/rest/api/v3/user/docs/UpdateUsername200Response.md @@ -0,0 +1,11 @@ +# UpdateUsername200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | The current username on file for your account. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/UpdateUsernameRequest.md b/rest/api/v3/user/docs/UpdateUsernameRequest.md new file mode 100644 index 00000000..85e3d52f --- /dev/null +++ b/rest/api/v3/user/docs/UpdateUsernameRequest.md @@ -0,0 +1,11 @@ +# UpdateUsernameRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | The new username you would like to use for your account. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/docs/UserProfile.md b/rest/api/v3/user/docs/UserProfile.md new file mode 100644 index 00000000..bd9d571e --- /dev/null +++ b/rest/api/v3/user/docs/UserProfile.md @@ -0,0 +1,21 @@ +# UserProfile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | The street address for this user profile. |[optional] +**Address2** | **string** | An optional second line for the street address of this user profile. |[optional] +**City** | **string** | The city for the user profile. |[optional] +**Company** | **string** | That company that this user profile is associated with. |[optional] +**Country** | **string** | Th country of this user profile. |[optional] +**FirstName** | **string** | The first name of the user. |[optional] +**LastName** | **string** | The last name of the user. |[optional] +**Phone** | **string** | The phone number for the user. |[optional] +**State** | **string** | The state for this user. |[optional] +**Website** | **string** | The website associated with this user. |[optional] +**Zip** | **string** | The zip code for this user. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/user/model_error_response.go b/rest/api/v3/user/model_error_response.go new file mode 100644 index 00000000..a7e81b7e --- /dev/null +++ b/rest/api/v3/user/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/user/model_error_response_errors_inner.go b/rest/api/v3/user/model_error_response_errors_inner.go new file mode 100644 index 00000000..623e0242 --- /dev/null +++ b/rest/api/v3/user/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/user/model_get_user_account_response.go b/rest/api/v3/user/model_get_user_account_response.go new file mode 100644 index 00000000..c910dc5f --- /dev/null +++ b/rest/api/v3/user/model_get_user_account_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GETUserAccountResponse struct for GETUserAccountResponse +type GETUserAccountResponse struct { + // The type of account for this user. + Type Type `json:"type"` + // The sender reputation for this user. + Reputation float32 `json:"reputation"` +} diff --git a/rest/api/v3/user/model_get_user_profile_response.go b/rest/api/v3/user/model_get_user_profile_response.go new file mode 100644 index 00000000..ab9bc7d3 --- /dev/null +++ b/rest/api/v3/user/model_get_user_profile_response.go @@ -0,0 +1,40 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GETUserProfileResponse struct for GETUserProfileResponse +type GETUserProfileResponse struct { + // The user's address. + Address string `json:"address"` + // The second line of the user's address. + Address2 *string `json:"address2,omitempty"` + // The user's city. + City string `json:"city"` + // The name of the user's company. + Company string `json:"company"` + // The user's country. + Country string `json:"country"` + // The user's first name. + FirstName string `json:"first_name"` + // The user's last name. + LastName string `json:"last_name"` + // The user's phone number. + Phone string `json:"phone"` + // The user's state. + State string `json:"state"` + // The user's website URL. + Website string `json:"website"` + // The user's zip code. + Zip string `json:"zip"` +} diff --git a/rest/api/v3/user/model_list_credit_200_response.go b/rest/api/v3/user/model_list_credit_200_response.go new file mode 100644 index 00000000..515d6d5d --- /dev/null +++ b/rest/api/v3/user/model_list_credit_200_response.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListCredit200Response struct for ListCredit200Response +type ListCredit200Response struct { + // The remaining number of credits available on your account. + Remain int32 `json:"remain"` + // The total number of credits assigned to your account. + Total int32 `json:"total"` + // The number of overdrawn credits for your account. + Overage int32 `json:"overage"` + // The number of credits that you have used. + Used int32 `json:"used"` + // The date that your credit balance was last reset. + LastReset string `json:"last_reset"` + // The next date that your credit balance will be reset. + NextReset string `json:"next_reset"` + // The frequency at which your credit balance will be reset. + ResetFrequency string `json:"reset_frequency"` +} diff --git a/rest/api/v3/user/model_list_email_200_response.go b/rest/api/v3/user/model_list_email_200_response.go new file mode 100644 index 00000000..d1b39a6e --- /dev/null +++ b/rest/api/v3/user/model_list_email_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListEmail200Response struct for ListEmail200Response +type ListEmail200Response struct { + // The email address currently on file for your account. + Email string `json:"email"` +} diff --git a/rest/api/v3/user/model_list_username_200_response.go b/rest/api/v3/user/model_list_username_200_response.go new file mode 100644 index 00000000..b024b8c7 --- /dev/null +++ b/rest/api/v3/user/model_list_username_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListUsername200Response struct for ListUsername200Response +type ListUsername200Response struct { + // Your account username. + Username string `json:"username"` + // The user ID for your account. + UserId int32 `json:"user_id"` +} diff --git a/rest/api/v3/user/model_type.go b/rest/api/v3/user/model_type.go new file mode 100644 index 00000000..aa8dbdd4 --- /dev/null +++ b/rest/api/v3/user/model_type.go @@ -0,0 +1,23 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// Type the model 'Type' +type Type string + +// List of Type +const ( + TYPE_FREE Type = "free" + TYPE_PAID Type = "paid" +) diff --git a/rest/api/v3/user/model_update_email_200_response.go b/rest/api/v3/user/model_update_email_200_response.go new file mode 100644 index 00000000..12777e4f --- /dev/null +++ b/rest/api/v3/user/model_update_email_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateEmail200Response struct for UpdateEmail200Response +type UpdateEmail200Response struct { + // The current email address on file for your account. + Email string `json:"email"` +} diff --git a/rest/api/v3/user/model_update_email_request.go b/rest/api/v3/user/model_update_email_request.go new file mode 100644 index 00000000..b6d70118 --- /dev/null +++ b/rest/api/v3/user/model_update_email_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateEmailRequest struct for UpdateEmailRequest +type UpdateEmailRequest struct { + // The new email address that you would like to use for your account. + Email *string `json:"email,omitempty"` +} diff --git a/rest/api/v3/user/model_update_password_request.go b/rest/api/v3/user/model_update_password_request.go new file mode 100644 index 00000000..ed046469 --- /dev/null +++ b/rest/api/v3/user/model_update_password_request.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdatePasswordRequest struct for UpdatePasswordRequest +type UpdatePasswordRequest struct { + // The new password you would like to use for your account. + NewPassword string `json:"new_password"` + // The old password for your account. + OldPassword string `json:"old_password"` +} diff --git a/rest/api/v3/user/model_update_username_200_response.go b/rest/api/v3/user/model_update_username_200_response.go new file mode 100644 index 00000000..455a234c --- /dev/null +++ b/rest/api/v3/user/model_update_username_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateUsername200Response struct for UpdateUsername200Response +type UpdateUsername200Response struct { + // The current username on file for your account. + Username string `json:"username"` +} diff --git a/rest/api/v3/user/model_update_username_request.go b/rest/api/v3/user/model_update_username_request.go new file mode 100644 index 00000000..ec922edc --- /dev/null +++ b/rest/api/v3/user/model_update_username_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateUsernameRequest struct for UpdateUsernameRequest +type UpdateUsernameRequest struct { + // The new username you would like to use for your account. + Username *string `json:"username,omitempty"` +} diff --git a/rest/api/v3/user/model_user_profile.go b/rest/api/v3/user/model_user_profile.go new file mode 100644 index 00000000..9d9ffcf4 --- /dev/null +++ b/rest/api/v3/user/model_user_profile.go @@ -0,0 +1,40 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid User API +* The Twilio SendGrid User API allows you to modify the settings of a SendGrid user account such as the user's email address or username. Keeping your user profile up to date helps SendGrid verify who you are and share important communications with you. See [**Account Details**](https://docs.sendgrid.com/ui/account-and-settings/account) for more information. You can also manage your user settings in the [SendGrid application user interface](https://app.sendgrid.com/account/details). +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UserProfile struct for UserProfile +type UserProfile struct { + // The street address for this user profile. + Address *string `json:"address,omitempty"` + // An optional second line for the street address of this user profile. + Address2 *string `json:"address2,omitempty"` + // The city for the user profile. + City *string `json:"city,omitempty"` + // That company that this user profile is associated with. + Company *string `json:"company,omitempty"` + // Th country of this user profile. + Country *string `json:"country,omitempty"` + // The first name of the user. + FirstName *string `json:"first_name,omitempty"` + // The last name of the user. + LastName *string `json:"last_name,omitempty"` + // The phone number for the user. + Phone *string `json:"phone,omitempty"` + // The state for this user. + State *string `json:"state,omitempty"` + // The website associated with this user. + Website *string `json:"website,omitempty"` + // The zip code for this user. + Zip *string `json:"zip,omitempty"` +} diff --git a/rest/api/v3/verified_senders/README.md b/rest/api/v3/verified_senders/README.md new file mode 100644 index 00000000..f2f60a3e --- /dev/null +++ b/rest/api/v3/verified_senders/README.md @@ -0,0 +1,84 @@ +# Go API client for + +The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. + +You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. + +This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.559197+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateVerifiedSender* | [**CreateVerifiedSender**](docs/CreateVerifiedSender.md#createverifiedsender) | **Post** /v3/verified_senders | Create Verified Sender Request +*DeleteVerifiedSender* | [**DeleteVerifiedSender**](docs/DeleteVerifiedSender.md#deleteverifiedsender) | **Delete** /v3/verified_senders/{Id} | Delete Verified Sender +*ListVerifiedSender* | [**ListVerifiedSender**](docs/ListVerifiedSender.md#listverifiedsender) | **Get** /v3/verified_senders | Get All Verified Senders +*ListVerifiedSenderDomain* | [**ListVerifiedSenderDomain**](docs/ListVerifiedSenderDomain.md#listverifiedsenderdomain) | **Get** /v3/verified_senders/domains | Domain Warn List +*ListVerifiedSenderStepsCompleted* | [**ListVerifiedSenderStepsCompleted**](docs/ListVerifiedSenderStepsCompleted.md#listverifiedsenderstepscompleted) | **Get** /v3/verified_senders/steps_completed | Completed Steps +*ResendVerifiedSender* | [**ResendVerifiedSender**](docs/ResendVerifiedSender.md#resendverifiedsender) | **Post** /v3/verified_senders/resend/{Id} | Resend Verified Sender Request +*UpdateVerifiedSender* | [**UpdateVerifiedSender**](docs/UpdateVerifiedSender.md#updateverifiedsender) | **Patch** /v3/verified_senders/{Id} | Edit Verified Sender +*VerifySenderToken* | [**VerifySenderToken**](docs/VerifySenderToken.md#verifysendertoken) | **Get** /v3/verified_senders/verify/{Token} | Verify Sender Request + + +## Documentation For Models + + - [CreateVerifiedSender400Response](CreateVerifiedSender400Response.md) + - [CreateVerifiedSender400ResponseErrorsInner](CreateVerifiedSender400ResponseErrorsInner.md) + - [DeleteVerifiedSender403Response](DeleteVerifiedSender403Response.md) + - [DeleteVerifiedSender403ResponseErrorsInner](DeleteVerifiedSender403ResponseErrorsInner.md) + - [DeleteVerifiedSender404Response](DeleteVerifiedSender404Response.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [ListVerifiedSender200Response](ListVerifiedSender200Response.md) + - [ListVerifiedSenderDomain200Response](ListVerifiedSenderDomain200Response.md) + - [ListVerifiedSenderDomain200ResponseResults](ListVerifiedSenderDomain200ResponseResults.md) + - [ListVerifiedSenderStepsCompleted200Response](ListVerifiedSenderStepsCompleted200Response.md) + - [ListVerifiedSenderStepsCompleted200ResponseResults](ListVerifiedSenderStepsCompleted200ResponseResults.md) + - [VerifiedSenderRequest](VerifiedSenderRequest.md) + - [VerifiedSenderResponse](VerifiedSenderResponse.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/verified_senders/api_create_verified_sender.go b/rest/api/v3/verified_senders/api_create_verified_sender.go new file mode 100644 index 00000000..f2443d7b --- /dev/null +++ b/rest/api/v3/verified_senders/api_create_verified_sender.go @@ -0,0 +1,97 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateVerifiedSenderParam struct { + // + VerifiedSenderRequest *VerifiedSenderRequest `json:"VerifiedSenderRequest,omitempty"` +} + +func (params *CreateVerifiedSenderParam) SetVerifiedSenderRequest(VerifiedSenderRequest VerifiedSenderRequest) *CreateVerifiedSenderParam { + params.VerifiedSenderRequest = &VerifiedSenderRequest + return params +} + +// **This endpoint allows you to create a new Sender Identify**. Upon successful submission of a `POST` request to this endpoint, an identity will be created, and a verification email will be sent to the address assigned to the `from_email` field. You must complete the verification process using the sent email to fully verify the sender. If you need to resend the verification email, you can do so with the Resend Verified Sender Request, `/resend/{id}`, endpoint. If you need to authenticate a domain rather than a Single Sender, see the [Domain Authentication API](https://docs.sendgrid.com/api-reference/domain-authentication/authenticate-a-domain). +func (c *ApiService) CreateVerifiedSender(params *CreateVerifiedSenderParam) (interface{}, error) { + path := "/v3/verified_senders" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.VerifiedSenderRequest != nil { + b, err := json.Marshal(*params.VerifiedSenderRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &VerifiedSenderResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateVerifiedSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/api_delete_verified_sender.go b/rest/api/v3/verified_senders/api_delete_verified_sender.go new file mode 100644 index 00000000..bf97081c --- /dev/null +++ b/rest/api/v3/verified_senders/api_delete_verified_sender.go @@ -0,0 +1,85 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteVerifiedSenderParam struct { + // + Id *string `json:"id"` +} + +func (params *DeleteVerifiedSenderParam) SetId(Id string) *DeleteVerifiedSenderParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to delete a Sender Identity**. Pass the `id` assigned to a Sender Identity to this endpoint to delete the Sender Identity from your account. You can retrieve the IDs associated with Sender Identities using the \"Get All Verified Senders\" endpoint. +func (c *ApiService) DeleteVerifiedSender(params *DeleteVerifiedSenderParam) (interface{}, error) { + path := "/v3/verified_senders/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &DeleteVerifiedSender403Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteVerifiedSender404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/api_list_verified_sender.go b/rest/api/v3/verified_senders/api_list_verified_sender.go new file mode 100644 index 00000000..e7b8ab0e --- /dev/null +++ b/rest/api/v3/verified_senders/api_list_verified_sender.go @@ -0,0 +1,103 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListVerifiedSenderParam struct { + // Specifies the number of results to be returned by the API. This parameter can be used to limit the results returned or in combination with the `lastSeenID` parameter to iterate through paginated results. + Limit *float32 `json:"limit,omitempty"` + // Returns senders with an ID number occurring after the passed in ID. In other words, the `lastSeenID` provides a starting point from which SendGrid will iterate to find Sender Identities associated with your account. + LastSeenID *float32 `json:"lastSeenID,omitempty"` + // Returns information about only the Sender Identity passed in the request. + Id *int32 `json:"id,omitempty"` +} + +func (params *ListVerifiedSenderParam) SetLimit(Limit float32) *ListVerifiedSenderParam { + params.Limit = &Limit + return params +} +func (params *ListVerifiedSenderParam) SetLastSeenID(LastSeenID float32) *ListVerifiedSenderParam { + params.LastSeenID = &LastSeenID + return params +} +func (params *ListVerifiedSenderParam) SetId(Id int32) *ListVerifiedSenderParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to retrieve all the Sender Identities associated with an account.** This endpoint will return both verified and unverified senders. You can limit the number of results returned using the `limit`, `lastSeenID`, and `id` query string parameters. * `limit` allows you to specify an exact number of Sender Identities to return. * `lastSeenID` will return senders with an ID number occuring after the passed in ID. In other words, the `lastSeenID` provides a starting point from which SendGrid will iterate to find Sender Identities associated with your account. * `id` will return information about only the Sender Identity passed in the request. +func (c *ApiService) ListVerifiedSender(params *ListVerifiedSenderParam) (interface{}, error) { + path := "/v3/verified_senders" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Limit != nil { + data.Set("limit", fmt.Sprint(*params.Limit)) + } + if params != nil && params.LastSeenID != nil { + data.Set("lastSeenID", fmt.Sprint(*params.LastSeenID)) + } + if params != nil && params.Id != nil { + data.Set("id", fmt.Sprint(*params.Id)) + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListVerifiedSender200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/api_list_verified_sender_domain.go b/rest/api/v3/verified_senders/api_list_verified_sender_domain.go new file mode 100644 index 00000000..84b8ec99 --- /dev/null +++ b/rest/api/v3/verified_senders/api_list_verified_sender_domain.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListVerifiedSenderDomainParam struct { +} + +// **This endpoint returns a list of domains known to implement DMARC and categorizes them by failure type — hard failure or soft failure**. Domains listed as hard failures will not deliver mail when used as a [Sender Identity](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/) due to the domain's DMARC policy settings. For example, using a `yahoo.com` email address as a Sender Identity will likely result in the rejection of your mail. For more information about DMARC, see [Everything about DMARC](https://sendgrid.com/docs/ui/sending-email/dmarc/). +func (c *ApiService) ListVerifiedSenderDomain() (interface{}, error) { + path := "/v3/verified_senders/domains" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListVerifiedSenderDomain200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/api_list_verified_sender_steps_completed.go b/rest/api/v3/verified_senders/api_list_verified_sender_steps_completed.go new file mode 100644 index 00000000..63aaa124 --- /dev/null +++ b/rest/api/v3/verified_senders/api_list_verified_sender_steps_completed.go @@ -0,0 +1,73 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListVerifiedSenderStepsCompletedParam struct { +} + +// **This endpoint allows you to determine which of SendGrid’s verification processes have been completed for an account**. This endpoint returns boolean values, `true` and `false`, for [Domain Authentication](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#domain-authentication), `domain_verified`, and [Single Sender Verification](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#single-sender-verification), `sender_verified`, for the account. An account may have one, both, or neither verification steps completed. If you need to authenticate a domain rather than a Single Sender, see the \"Authenticate a domain\" endpoint. +func (c *ApiService) ListVerifiedSenderStepsCompleted() (interface{}, error) { + path := "/v3/verified_senders/steps_completed" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListVerifiedSenderStepsCompleted200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/api_resend_verified_sender.go b/rest/api/v3/verified_senders/api_resend_verified_sender.go new file mode 100644 index 00000000..cedc66b8 --- /dev/null +++ b/rest/api/v3/verified_senders/api_resend_verified_sender.go @@ -0,0 +1,93 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type ResendVerifiedSenderParam struct { + // + Id *string `json:"id"` +} + +func (params *ResendVerifiedSenderParam) SetId(Id string) *ResendVerifiedSenderParam { + params.Id = &Id + return params +} + +// **This endpoint allows you to resend a verification email to a specified Sender Identity**. Passing the `id` assigned to a Sender Identity to this endpoint will resend a verification email to the `from_address` associated with the Sender Identity. This can be useful if someone loses their verification email or needs to have it resent for any other reason. You can retrieve the IDs associated with Sender Identities by passing a \"Get All Verified Senders\" endpoint. +func (c *ApiService) ResendVerifiedSender(params *ResendVerifiedSenderParam) (interface{}, error) { + path := "/v3/verified_senders/resend/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &DeleteVerifiedSender404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteVerifiedSender404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/api_service.go b/rest/api/v3/verified_senders/api_service.go new file mode 100644 index 00000000..4ef324e5 --- /dev/null +++ b/rest/api/v3/verified_senders/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/verified_senders/api_update_verified_sender.go b/rest/api/v3/verified_senders/api_update_verified_sender.go new file mode 100644 index 00000000..ef407e2f --- /dev/null +++ b/rest/api/v3/verified_senders/api_update_verified_sender.go @@ -0,0 +1,108 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateVerifiedSenderParam struct { + // + Id *string `json:"id"` + // + VerifiedSenderRequest *VerifiedSenderRequest `json:"VerifiedSenderRequest,omitempty"` +} + +func (params *UpdateVerifiedSenderParam) SetId(Id string) *UpdateVerifiedSenderParam { + params.Id = &Id + return params +} +func (params *UpdateVerifiedSenderParam) SetVerifiedSenderRequest(VerifiedSenderRequest VerifiedSenderRequest) *UpdateVerifiedSenderParam { + params.VerifiedSenderRequest = &VerifiedSenderRequest + return params +} + +// **This endpoint allows you to update an existing Sender Identity**. Pass the `id` assigned to a Sender Identity to this endpoint as a path parameter. Include any fields you wish to update in the request body in JSON format. You can retrieve the IDs associated with Sender Identities by passing a `GET` request to the Get All Verified Senders endpoint, `/verified_senders`. **Note:** Unlike a `PUT` request, `PATCH` allows you to update only the fields you wish to edit. Fields that are not passed as part of a request will remain unaltered. +func (c *ApiService) UpdateVerifiedSender(params *UpdateVerifiedSenderParam) (interface{}, error) { + path := "/v3/verified_senders/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.VerifiedSenderRequest != nil { + b, err := json.Marshal(*params.VerifiedSenderRequest) + if err != nil { + return nil, err + } + body = b + } + + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &VerifiedSenderResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateVerifiedSender400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &DeleteVerifiedSender404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteVerifiedSender404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/api_verify_sender_token.go b/rest/api/v3/verified_senders/api_verify_sender_token.go new file mode 100644 index 00000000..237bd442 --- /dev/null +++ b/rest/api/v3/verified_senders/api_verify_sender_token.go @@ -0,0 +1,77 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type VerifySenderTokenParam struct { + // + Token *string `json:"token"` +} + +func (params *VerifySenderTokenParam) SetToken(Token string) *VerifySenderTokenParam { + params.Token = &Token + return params +} + +// **This endpoint allows you to verify a sender requests.** The token is generated by SendGrid and included in a verification email delivered to the address that's pending verification. +func (c *ApiService) VerifySenderToken(params *VerifySenderTokenParam) (interface{}, error) { + path := "/v3/verified_senders/verify/{Token}" + if params != nil && params.Token != nil { + path = strings.Replace(path, "{"+"Token"+"}", *params.Token, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &DeleteVerifiedSender404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/verified_senders/docs/CreateVerifiedSender.md b/rest/api/v3/verified_senders/docs/CreateVerifiedSender.md new file mode 100644 index 00000000..2d228f45 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/CreateVerifiedSender.md @@ -0,0 +1,48 @@ +# CreateVerifiedSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateVerifiedSender**](CreateVerifiedSender.md#CreateVerifiedSender) | **Post** /v3/verified_senders | Create Verified Sender Request + + + +## CreateVerifiedSender + +> VerifiedSenderResponse CreateVerifiedSender(ctx, optional) + +Create Verified Sender Request + +**This endpoint allows you to create a new Sender Identify**. Upon successful submission of a `POST` request to this endpoint, an identity will be created, and a verification email will be sent to the address assigned to the `from_email` field. You must complete the verification process using the sent email to fully verify the sender. If you need to resend the verification email, you can do so with the Resend Verified Sender Request, `/resend/{id}`, endpoint. If you need to authenticate a domain rather than a Single Sender, see the [Domain Authentication API](https://docs.sendgrid.com/api-reference/domain-authentication/authenticate-a-domain). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateVerifiedSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**VerifiedSenderRequest** | [**VerifiedSenderRequest**](VerifiedSenderRequest.md) | + +### Return type + +[**VerifiedSenderResponse**](VerifiedSenderResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/docs/CreateVerifiedSender400Response.md b/rest/api/v3/verified_senders/docs/CreateVerifiedSender400Response.md new file mode 100644 index 00000000..600ce1a3 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/CreateVerifiedSender400Response.md @@ -0,0 +1,11 @@ +# CreateVerifiedSender400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]CreateVerifiedSender400ResponseErrorsInner**](CreateVerifiedSender400ResponseErrorsInner.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/CreateVerifiedSender400ResponseErrorsInner.md b/rest/api/v3/verified_senders/docs/CreateVerifiedSender400ResponseErrorsInner.md new file mode 100644 index 00000000..490e7921 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/CreateVerifiedSender400ResponseErrorsInner.md @@ -0,0 +1,13 @@ +# CreateVerifiedSender400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | |[optional] +**Message** | **string** | | +**ErrorId** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/DeleteVerifiedSender.md b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender.md new file mode 100644 index 00000000..64eb0663 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender.md @@ -0,0 +1,51 @@ +# DeleteVerifiedSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteVerifiedSender**](DeleteVerifiedSender.md#DeleteVerifiedSender) | **Delete** /v3/verified_senders/{Id} | Delete Verified Sender + + + +## DeleteVerifiedSender + +> map[string]interface{} DeleteVerifiedSender(ctx, Id) + +Delete Verified Sender + +**This endpoint allows you to delete a Sender Identity**. Pass the `id` assigned to a Sender Identity to this endpoint to delete the Sender Identity from your account. You can retrieve the IDs associated with Sender Identities using the \"Get All Verified Senders\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteVerifiedSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/docs/DeleteVerifiedSender403Response.md b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender403Response.md new file mode 100644 index 00000000..0f07e32b --- /dev/null +++ b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender403Response.md @@ -0,0 +1,11 @@ +# DeleteVerifiedSender403Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]DeleteVerifiedSender403ResponseErrorsInner**](DeleteVerifiedSender403ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/DeleteVerifiedSender403ResponseErrorsInner.md b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender403ResponseErrorsInner.md new file mode 100644 index 00000000..89ece5f2 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender403ResponseErrorsInner.md @@ -0,0 +1,12 @@ +# DeleteVerifiedSender403ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | | +**ErrorId** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/DeleteVerifiedSender404Response.md b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender404Response.md new file mode 100644 index 00000000..ef2a483c --- /dev/null +++ b/rest/api/v3/verified_senders/docs/DeleteVerifiedSender404Response.md @@ -0,0 +1,11 @@ +# DeleteVerifiedSender404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]DeleteVerifiedSender403ResponseErrorsInner**](DeleteVerifiedSender403ResponseErrorsInner.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ErrorResponse.md b/rest/api/v3/verified_senders/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ErrorResponseErrorsInner.md b/rest/api/v3/verified_senders/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSender.md b/rest/api/v3/verified_senders/docs/ListVerifiedSender.md new file mode 100644 index 00000000..115a8292 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSender.md @@ -0,0 +1,50 @@ +# ListVerifiedSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListVerifiedSender**](ListVerifiedSender.md#ListVerifiedSender) | **Get** /v3/verified_senders | Get All Verified Senders + + + +## ListVerifiedSender + +> ListVerifiedSender200Response ListVerifiedSender(ctx, optional) + +Get All Verified Senders + +**This endpoint allows you to retrieve all the Sender Identities associated with an account.** This endpoint will return both verified and unverified senders. You can limit the number of results returned using the `limit`, `lastSeenID`, and `id` query string parameters. * `limit` allows you to specify an exact number of Sender Identities to return. * `lastSeenID` will return senders with an ID number occuring after the passed in ID. In other words, the `lastSeenID` provides a starting point from which SendGrid will iterate to find Sender Identities associated with your account. * `id` will return information about only the Sender Identity passed in the request. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListVerifiedSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **float32** | Specifies the number of results to be returned by the API. This parameter can be used to limit the results returned or in combination with the `lastSeenID` parameter to iterate through paginated results. +**LastSeenID** | **float32** | Returns senders with an ID number occurring after the passed in ID. In other words, the `lastSeenID` provides a starting point from which SendGrid will iterate to find Sender Identities associated with your account. +**Id** | **int32** | Returns information about only the Sender Identity passed in the request. + +### Return type + +[**ListVerifiedSender200Response**](ListVerifiedSender200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSender200Response.md b/rest/api/v3/verified_senders/docs/ListVerifiedSender200Response.md new file mode 100644 index 00000000..6d5bfc9d --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSender200Response.md @@ -0,0 +1,11 @@ +# ListVerifiedSender200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]VerifiedSenderResponse**](VerifiedSenderResponse.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain.md b/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain.md new file mode 100644 index 00000000..1669c7e7 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain.md @@ -0,0 +1,44 @@ +# ListVerifiedSenderDomain + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListVerifiedSenderDomain**](ListVerifiedSenderDomain.md#ListVerifiedSenderDomain) | **Get** /v3/verified_senders/domains | Domain Warn List + + + +## ListVerifiedSenderDomain + +> ListVerifiedSenderDomain200Response ListVerifiedSenderDomain(ctx, ) + +Domain Warn List + +**This endpoint returns a list of domains known to implement DMARC and categorizes them by failure type — hard failure or soft failure**. Domains listed as hard failures will not deliver mail when used as a [Sender Identity](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/) due to the domain's DMARC policy settings. For example, using a `yahoo.com` email address as a Sender Identity will likely result in the rejection of your mail. For more information about DMARC, see [Everything about DMARC](https://sendgrid.com/docs/ui/sending-email/dmarc/). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListVerifiedSenderDomainParams struct + + +### Return type + +[**ListVerifiedSenderDomain200Response**](ListVerifiedSenderDomain200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200Response.md b/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200Response.md new file mode 100644 index 00000000..fed32ddc --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200Response.md @@ -0,0 +1,11 @@ +# ListVerifiedSenderDomain200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**ListVerifiedSenderDomain200ResponseResults**](ListVerifiedSenderDomain200ResponseResults.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200ResponseResults.md b/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200ResponseResults.md new file mode 100644 index 00000000..2217409c --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSenderDomain200ResponseResults.md @@ -0,0 +1,12 @@ +# ListVerifiedSenderDomain200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SoftFailures** | **[]string** | | +**HardFailures** | **[]string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted.md b/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted.md new file mode 100644 index 00000000..e793dd48 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted.md @@ -0,0 +1,44 @@ +# ListVerifiedSenderStepsCompleted + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListVerifiedSenderStepsCompleted**](ListVerifiedSenderStepsCompleted.md#ListVerifiedSenderStepsCompleted) | **Get** /v3/verified_senders/steps_completed | Completed Steps + + + +## ListVerifiedSenderStepsCompleted + +> ListVerifiedSenderStepsCompleted200Response ListVerifiedSenderStepsCompleted(ctx, ) + +Completed Steps + +**This endpoint allows you to determine which of SendGrid’s verification processes have been completed for an account**. This endpoint returns boolean values, `true` and `false`, for [Domain Authentication](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#domain-authentication), `domain_verified`, and [Single Sender Verification](https://sendgrid.com/docs/for-developers/sending-email/sender-identity/#single-sender-verification), `sender_verified`, for the account. An account may have one, both, or neither verification steps completed. If you need to authenticate a domain rather than a Single Sender, see the \"Authenticate a domain\" endpoint. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListVerifiedSenderStepsCompletedParams struct + + +### Return type + +[**ListVerifiedSenderStepsCompleted200Response**](ListVerifiedSenderStepsCompleted200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200Response.md b/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200Response.md new file mode 100644 index 00000000..2257b312 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200Response.md @@ -0,0 +1,11 @@ +# ListVerifiedSenderStepsCompleted200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**ListVerifiedSenderStepsCompleted200ResponseResults**](ListVerifiedSenderStepsCompleted200ResponseResults.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200ResponseResults.md b/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200ResponseResults.md new file mode 100644 index 00000000..b114a2ad --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ListVerifiedSenderStepsCompleted200ResponseResults.md @@ -0,0 +1,12 @@ +# ListVerifiedSenderStepsCompleted200ResponseResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SenderVerified** | **bool** | |[optional] +**DomainVerified** | **bool** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/ResendVerifiedSender.md b/rest/api/v3/verified_senders/docs/ResendVerifiedSender.md new file mode 100644 index 00000000..d7837503 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/ResendVerifiedSender.md @@ -0,0 +1,51 @@ +# ResendVerifiedSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ResendVerifiedSender**](ResendVerifiedSender.md#ResendVerifiedSender) | **Post** /v3/verified_senders/resend/{Id} | Resend Verified Sender Request + + + +## ResendVerifiedSender + +> map[string]interface{} ResendVerifiedSender(ctx, Id) + +Resend Verified Sender Request + +**This endpoint allows you to resend a verification email to a specified Sender Identity**. Passing the `id` assigned to a Sender Identity to this endpoint will resend a verification email to the `from_address` associated with the Sender Identity. This can be useful if someone loses their verification email or needs to have it resent for any other reason. You can retrieve the IDs associated with Sender Identities by passing a \"Get All Verified Senders\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a ResendVerifiedSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/docs/UpdateVerifiedSender.md b/rest/api/v3/verified_senders/docs/UpdateVerifiedSender.md new file mode 100644 index 00000000..cf10ee97 --- /dev/null +++ b/rest/api/v3/verified_senders/docs/UpdateVerifiedSender.md @@ -0,0 +1,52 @@ +# UpdateVerifiedSender + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateVerifiedSender**](UpdateVerifiedSender.md#UpdateVerifiedSender) | **Patch** /v3/verified_senders/{Id} | Edit Verified Sender + + + +## UpdateVerifiedSender + +> VerifiedSenderResponse UpdateVerifiedSender(ctx, Idoptional) + +Edit Verified Sender + +**This endpoint allows you to update an existing Sender Identity**. Pass the `id` assigned to a Sender Identity to this endpoint as a path parameter. Include any fields you wish to update in the request body in JSON format. You can retrieve the IDs associated with Sender Identities by passing a `GET` request to the Get All Verified Senders endpoint, `/verified_senders`. **Note:** Unlike a `PUT` request, `PATCH` allows you to update only the fields you wish to edit. Fields that are not passed as part of a request will remain unaltered. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateVerifiedSenderParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**VerifiedSenderRequest** | [**VerifiedSenderRequest**](VerifiedSenderRequest.md) | + +### Return type + +[**VerifiedSenderResponse**](VerifiedSenderResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/docs/VerifiedSenderRequest.md b/rest/api/v3/verified_senders/docs/VerifiedSenderRequest.md new file mode 100644 index 00000000..adb9c1cf --- /dev/null +++ b/rest/api/v3/verified_senders/docs/VerifiedSenderRequest.md @@ -0,0 +1,21 @@ +# VerifiedSenderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Nickname** | **string** | | +**FromEmail** | **string** | | +**FromName** | **string** | |[optional] +**ReplyTo** | **string** | | +**ReplyToName** | **string** | |[optional] +**Address** | **string** | |[optional] +**Address2** | **string** | |[optional] +**State** | **string** | |[optional] +**City** | **string** | |[optional] +**Zip** | **string** | |[optional] +**Country** | **string** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/VerifiedSenderResponse.md b/rest/api/v3/verified_senders/docs/VerifiedSenderResponse.md new file mode 100644 index 00000000..4a6bf8df --- /dev/null +++ b/rest/api/v3/verified_senders/docs/VerifiedSenderResponse.md @@ -0,0 +1,24 @@ +# VerifiedSenderResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | |[optional] +**Nickname** | **string** | |[optional] +**FromEmail** | **string** | |[optional] +**FromName** | **string** | |[optional] +**ReplyTo** | **string** | |[optional] +**ReplyToName** | **string** | |[optional] +**Address** | **string** | |[optional] +**Address2** | **string** | |[optional] +**State** | **string** | |[optional] +**City** | **string** | |[optional] +**Zip** | **string** | |[optional] +**Country** | **string** | |[optional] +**Verified** | **bool** | |[optional] +**Locked** | **bool** | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/verified_senders/docs/VerifySenderToken.md b/rest/api/v3/verified_senders/docs/VerifySenderToken.md new file mode 100644 index 00000000..5dec772e --- /dev/null +++ b/rest/api/v3/verified_senders/docs/VerifySenderToken.md @@ -0,0 +1,51 @@ +# VerifySenderToken + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**VerifySenderToken**](VerifySenderToken.md#VerifySenderToken) | **Get** /v3/verified_senders/verify/{Token} | Verify Sender Request + + + +## VerifySenderToken + +> VerifySenderToken(ctx, Token) + +Verify Sender Request + +**This endpoint allows you to verify a sender requests.** The token is generated by SendGrid and included in a verification email delivered to the address that's pending verification. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Token** | **string** | + +### Other Parameters + +Other parameters are passed through a pointer to a VerifySenderTokenParams struct + + +Name | Type | Description +------------- | ------------- | ------------- + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/verified_senders/model_create_verified_sender_400_response.go b/rest/api/v3/verified_senders/model_create_verified_sender_400_response.go new file mode 100644 index 00000000..5b15d971 --- /dev/null +++ b/rest/api/v3/verified_senders/model_create_verified_sender_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateVerifiedSender400Response struct for CreateVerifiedSender400Response +type CreateVerifiedSender400Response struct { + Errors []CreateVerifiedSender400ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/verified_senders/model_create_verified_sender_400_response_errors_inner.go b/rest/api/v3/verified_senders/model_create_verified_sender_400_response_errors_inner.go new file mode 100644 index 00000000..6682ad11 --- /dev/null +++ b/rest/api/v3/verified_senders/model_create_verified_sender_400_response_errors_inner.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateVerifiedSender400ResponseErrorsInner struct for CreateVerifiedSender400ResponseErrorsInner +type CreateVerifiedSender400ResponseErrorsInner struct { + Field *string `json:"field,omitempty"` + Message string `json:"message"` + ErrorId string `json:"error_id"` +} diff --git a/rest/api/v3/verified_senders/model_delete_verified_sender_403_response.go b/rest/api/v3/verified_senders/model_delete_verified_sender_403_response.go new file mode 100644 index 00000000..2aa7215f --- /dev/null +++ b/rest/api/v3/verified_senders/model_delete_verified_sender_403_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteVerifiedSender403Response struct for DeleteVerifiedSender403Response +type DeleteVerifiedSender403Response struct { + Errors *[]DeleteVerifiedSender403ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/verified_senders/model_delete_verified_sender_403_response_errors_inner.go b/rest/api/v3/verified_senders/model_delete_verified_sender_403_response_errors_inner.go new file mode 100644 index 00000000..f3f8a340 --- /dev/null +++ b/rest/api/v3/verified_senders/model_delete_verified_sender_403_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteVerifiedSender403ResponseErrorsInner struct for DeleteVerifiedSender403ResponseErrorsInner +type DeleteVerifiedSender403ResponseErrorsInner struct { + Message string `json:"message"` + ErrorId string `json:"error_id"` +} diff --git a/rest/api/v3/verified_senders/model_delete_verified_sender_404_response.go b/rest/api/v3/verified_senders/model_delete_verified_sender_404_response.go new file mode 100644 index 00000000..b25527ed --- /dev/null +++ b/rest/api/v3/verified_senders/model_delete_verified_sender_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// DeleteVerifiedSender404Response struct for DeleteVerifiedSender404Response +type DeleteVerifiedSender404Response struct { + Errors []DeleteVerifiedSender403ResponseErrorsInner `json:"errors"` +} diff --git a/rest/api/v3/verified_senders/model_error_response.go b/rest/api/v3/verified_senders/model_error_response.go new file mode 100644 index 00000000..e607f39f --- /dev/null +++ b/rest/api/v3/verified_senders/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/verified_senders/model_error_response_errors_inner.go b/rest/api/v3/verified_senders/model_error_response_errors_inner.go new file mode 100644 index 00000000..f544f8bb --- /dev/null +++ b/rest/api/v3/verified_senders/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/verified_senders/model_list_verified_sender_200_response.go b/rest/api/v3/verified_senders/model_list_verified_sender_200_response.go new file mode 100644 index 00000000..3a68dd4b --- /dev/null +++ b/rest/api/v3/verified_senders/model_list_verified_sender_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListVerifiedSender200Response struct for ListVerifiedSender200Response +type ListVerifiedSender200Response struct { + Results *[]VerifiedSenderResponse `json:"results,omitempty"` +} diff --git a/rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response.go b/rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response.go new file mode 100644 index 00000000..3f77bce9 --- /dev/null +++ b/rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListVerifiedSenderDomain200Response struct for ListVerifiedSenderDomain200Response +type ListVerifiedSenderDomain200Response struct { + Results ListVerifiedSenderDomain200ResponseResults `json:"results"` +} diff --git a/rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response_results.go b/rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response_results.go new file mode 100644 index 00000000..703a3515 --- /dev/null +++ b/rest/api/v3/verified_senders/model_list_verified_sender_domain_200_response_results.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListVerifiedSenderDomain200ResponseResults struct for ListVerifiedSenderDomain200ResponseResults +type ListVerifiedSenderDomain200ResponseResults struct { + SoftFailures []string `json:"soft_failures"` + HardFailures []string `json:"hard_failures"` +} diff --git a/rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response.go b/rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response.go new file mode 100644 index 00000000..a252d30c --- /dev/null +++ b/rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListVerifiedSenderStepsCompleted200Response struct for ListVerifiedSenderStepsCompleted200Response +type ListVerifiedSenderStepsCompleted200Response struct { + Results *ListVerifiedSenderStepsCompleted200ResponseResults `json:"results,omitempty"` +} diff --git a/rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response_results.go b/rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response_results.go new file mode 100644 index 00000000..21b54ce8 --- /dev/null +++ b/rest/api/v3/verified_senders/model_list_verified_sender_steps_completed_200_response_results.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListVerifiedSenderStepsCompleted200ResponseResults struct for ListVerifiedSenderStepsCompleted200ResponseResults +type ListVerifiedSenderStepsCompleted200ResponseResults struct { + SenderVerified *bool `json:"sender_verified,omitempty"` + DomainVerified *bool `json:"domain_verified,omitempty"` +} diff --git a/rest/api/v3/verified_senders/model_verified_sender_request.go b/rest/api/v3/verified_senders/model_verified_sender_request.go new file mode 100644 index 00000000..3dc370c4 --- /dev/null +++ b/rest/api/v3/verified_senders/model_verified_sender_request.go @@ -0,0 +1,29 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// VerifiedSenderRequest struct for VerifiedSenderRequest +type VerifiedSenderRequest struct { + Nickname string `json:"nickname"` + FromEmail string `json:"from_email"` + FromName *string `json:"from_name,omitempty"` + ReplyTo string `json:"reply_to"` + ReplyToName *string `json:"reply_to_name,omitempty"` + Address *string `json:"address,omitempty"` + Address2 *string `json:"address2,omitempty"` + State *string `json:"state,omitempty"` + City *string `json:"city,omitempty"` + Zip *string `json:"zip,omitempty"` + Country *string `json:"country,omitempty"` +} diff --git a/rest/api/v3/verified_senders/model_verified_sender_response.go b/rest/api/v3/verified_senders/model_verified_sender_response.go new file mode 100644 index 00000000..308efbc6 --- /dev/null +++ b/rest/api/v3/verified_senders/model_verified_sender_response.go @@ -0,0 +1,32 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Verified Senders API +* The Twilio SendGrid Verified Senders API allows you to programmatically manage the Sender Identities that are authorized to send email for your account. You can also manage Sender Identities in the [SendGrid application user interface](https://app.sendgrid.com/settings/sender_auth). See [**Single Sender Verification**](https://sendgrid.com/docs/ui/sending-email/sender-verification/) for more information. You an use this API to create new Sender Identities, retrieve a list of existing Sender Identities, check the status of a Sender Identity, update a Sender Identity, and delete a Sender Identity. This API offers additional operations to check for domains known to implement DMARC and resend verification emails to Sender Identities that have yet to complete the verification process. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// VerifiedSenderResponse struct for VerifiedSenderResponse +type VerifiedSenderResponse struct { + Id *int32 `json:"id,omitempty"` + Nickname *string `json:"nickname,omitempty"` + FromEmail *string `json:"from_email,omitempty"` + FromName *string `json:"from_name,omitempty"` + ReplyTo *string `json:"reply_to,omitempty"` + ReplyToName *string `json:"reply_to_name,omitempty"` + Address *string `json:"address,omitempty"` + Address2 *string `json:"address2,omitempty"` + State *string `json:"state,omitempty"` + City *string `json:"city,omitempty"` + Zip *string `json:"zip,omitempty"` + Country *string `json:"country,omitempty"` + Verified *bool `json:"verified,omitempty"` + Locked *bool `json:"locked,omitempty"` +} diff --git a/rest/api/v3/webhooks/README.md b/rest/api/v3/webhooks/README.md new file mode 100644 index 00000000..4eedcf03 --- /dev/null +++ b/rest/api/v3/webhooks/README.md @@ -0,0 +1,100 @@ +# Go API client for + +The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. + +Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. + +The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project from the OpenAPI specs located at [twilio/sendgrid-oai](https://github.com/twilio/sendgrid-oai/tree/main/spec). By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build date: 2024-10-04T18:29:02.588795+05:30[Asia/Kolkata] +- Build package: com.sendgrid.oai.go.SendgridGoGenerator +For more information, please visit [https://support.sendgrid.com/hc/en-us](https://support.sendgrid.com/hc/en-us) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import "./" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.sendgrid.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CreateEventWebhook* | [**CreateEventWebhook**](docs/CreateEventWebhook.md#createeventwebhook) | **Post** /v3/user/webhooks/event/settings | Create a new Event Webhook +*CreateParseSetting* | [**CreateParseSetting**](docs/CreateParseSetting.md#createparsesetting) | **Post** /v3/user/webhooks/parse/settings | Create a parse setting +*DeleteEventWebhook* | [**DeleteEventWebhook**](docs/DeleteEventWebhook.md#deleteeventwebhook) | **Delete** /v3/user/webhooks/event/settings/{Id} | Delete a single Event Webhook by ID. +*DeleteParseSetting* | [**DeleteParseSetting**](docs/DeleteParseSetting.md#deleteparsesetting) | **Delete** /v3/user/webhooks/parse/settings/{Hostname} | Delete a parse setting +*GetEventWebhook* | [**GetEventWebhook**](docs/GetEventWebhook.md#geteventwebhook) | **Get** /v3/user/webhooks/event/settings/{Id} | Get the settings for a single Event Webhook. +*GetParseSetting* | [**GetParseSetting**](docs/GetParseSetting.md#getparsesetting) | **Get** /v3/user/webhooks/parse/settings/{Hostname} | Retrieve a specific parse setting +*GetSignedEventWebhook* | [**GetSignedEventWebhook**](docs/GetSignedEventWebhook.md#getsignedeventwebhook) | **Get** /v3/user/webhooks/event/settings/signed/{Id} | Get Signed Event Webhook's Public Key +*ListEventWebhook* | [**ListEventWebhook**](docs/ListEventWebhook.md#listeventwebhook) | **Get** /v3/user/webhooks/event/settings/all | Retrieve all of your Event Webhooks. +*ListParseSetting* | [**ListParseSetting**](docs/ListParseSetting.md#listparsesetting) | **Get** /v3/user/webhooks/parse/settings | Retrieve all parse settings +*ListParseStatic* | [**ListParseStatic**](docs/ListParseStatic.md#listparsestatic) | **Get** /v3/user/webhooks/parse/stats | Retrieves Inbound Parse Webhook statistics. +*TestEventWebhook* | [**TestEventWebhook**](docs/TestEventWebhook.md#testeventwebhook) | **Post** /v3/user/webhooks/event/test | Test an Event Webhook's settings +*UpdateEventWebhook* | [**UpdateEventWebhook**](docs/UpdateEventWebhook.md#updateeventwebhook) | **Patch** /v3/user/webhooks/event/settings/{Id} | Update a single Event Webhook by ID. +*UpdateParseSetting* | [**UpdateParseSetting**](docs/UpdateParseSetting.md#updateparsesetting) | **Patch** /v3/user/webhooks/parse/settings/{Hostname} | Update a parse setting +*UpdateSignedEventWebhook* | [**UpdateSignedEventWebhook**](docs/UpdateSignedEventWebhook.md#updatesignedeventwebhook) | **Patch** /v3/user/webhooks/event/settings/signed/{Id} | Toggle signature verification for a single Event Webhook by ID + + +## Documentation For Models + + - [AggregatedBy](AggregatedBy.md) + - [CreateEventWebhook400Response](CreateEventWebhook400Response.md) + - [CreateEventWebhook400ResponseErrorsInner](CreateEventWebhook400ResponseErrorsInner.md) + - [ErrorResponse](ErrorResponse.md) + - [ErrorResponseErrorsInner](ErrorResponseErrorsInner.md) + - [EventWebhookAllResponse](EventWebhookAllResponse.md) + - [EventWebhookBaseResponseProps](EventWebhookBaseResponseProps.md) + - [EventWebhookDateResponseProps](EventWebhookDateResponseProps.md) + - [EventWebhookNoDatesResponse](EventWebhookNoDatesResponse.md) + - [EventWebhookOauthResponseProps](EventWebhookOauthResponseProps.md) + - [EventWebhookRequest](EventWebhookRequest.md) + - [EventWebhookSignedResponse](EventWebhookSignedResponse.md) + - [EventWebhookSignedResponseProp](EventWebhookSignedResponseProp.md) + - [EventWebhookTestRequest](EventWebhookTestRequest.md) + - [EventWebhookUnsignedResponse](EventWebhookUnsignedResponse.md) + - [GetSignedEventWebhook200Response](GetSignedEventWebhook200Response.md) + - [GetSignedEventWebhook404Response](GetSignedEventWebhook404Response.md) + - [GetSignedEventWebhook404ResponseErrorsInner](GetSignedEventWebhook404ResponseErrorsInner.md) + - [ListParseSetting200Response](ListParseSetting200Response.md) + - [ListParseStatic200ResponseInner](ListParseStatic200ResponseInner.md) + - [ListParseStatic200ResponseInnerStatsInner](ListParseStatic200ResponseInnerStatsInner.md) + - [ListParseStatic200ResponseInnerStatsInnerMetrics](ListParseStatic200ResponseInnerStatsInnerMetrics.md) + - [ParseSetting](ParseSetting.md) + - [UpdateSignedEventWebhookRequest](UpdateSignedEventWebhookRequest.md) + + +## Documentation For Authorization + + + +## BearerAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + diff --git a/rest/api/v3/webhooks/api_create_event_webhook.go b/rest/api/v3/webhooks/api_create_event_webhook.go new file mode 100644 index 00000000..06a7f84e --- /dev/null +++ b/rest/api/v3/webhooks/api_create_event_webhook.go @@ -0,0 +1,82 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateEventWebhookParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + EventWebhookRequest *EventWebhookRequest `json:"EventWebhookRequest,omitempty"` +} + +func (params *CreateEventWebhookParam) SetOnbehalfof(Onbehalfof string) *CreateEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateEventWebhookParam) SetEventWebhookRequest(EventWebhookRequest EventWebhookRequest) *CreateEventWebhookParam { + params.EventWebhookRequest = &EventWebhookRequest + return params +} + +// **This endpoint allows you to create a new Event Webhook.** When creating a webhook, you will provide a URL where you want the webhook to send POST requests, and you will select which events you want to receive in those request. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Webhook identifiers When your webhook is succesfully created, you will receive a webhook `id` in the response returned by this endpoint. You can use that ID to [update the webhook's settings](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook), [delete the webhook](https://docs.sendgrid.com/api-reference/webhooks/delete-an-event-webhook), [enable or disable signature verification for the webhook](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook), and, if signature verification is enabled, [retrieve the webhook's public key](https://docs.sendgrid.com/api-reference/webhooks/get-signed-event-webhooks-public-key). You may also assign an optional friendly name to each of your webhooks. The friendly name is for convenience only and should not be used to programmatically differentiate your webhooks because it does not need to be unique. Use the webhook ID to reliably differentiate among your webhooks. ### OAuth You can optionally configure OAuth verification for your webhook at the time of creation by passing the appropriate values in the `oauth_client_id`, `oauth_client_secret`, and `oauth_token_url` properties. You can enable or disable OAuth for the webhook after creation with the [**Update an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) operation. You may share one OAuth configuration across all your webhooks or create unique credentials for each. See our [webhook security documentation](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features#oauth-20) for details about OAuth and the Event Webhook. ### Signature verification Enabling signature verification for your webhook is a separate process and cannot be done at the time of creation with this endpoint. You can use the webhook ID to [enable or disable signature verification with the endpoint dedicated for that operation](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook). +func (c *ApiService) CreateEventWebhook(params *CreateEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/settings" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.EventWebhookRequest != nil { + b, err := json.Marshal(*params.EventWebhookRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &EventWebhookUnsignedResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateEventWebhook400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_create_parse_setting.go b/rest/api/v3/webhooks/api_create_parse_setting.go new file mode 100644 index 00000000..06da2b1e --- /dev/null +++ b/rest/api/v3/webhooks/api_create_parse_setting.go @@ -0,0 +1,98 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type CreateParseSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + ParseSetting *ParseSetting `json:"ParseSetting,omitempty"` +} + +func (params *CreateParseSettingParam) SetOnbehalfof(Onbehalfof string) *CreateParseSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *CreateParseSettingParam) SetParseSetting(ParseSetting ParseSetting) *CreateParseSettingParam { + params.ParseSetting = &ParseSetting + return params +} + +// **This endpoint allows you to create a new inbound parse setting.** Creating an Inbound Parse setting requires two pieces of information: a `url` and a `hostname`. The `hostname` must correspond to a domain authenticated by Twilio SendGrid on your account. If you need to complete domain authentication, you can use the [Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth) or the **Authenticate a Domain** endpoint. See [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) for instructions. Any email received by the `hostname` will be parsed when you complete this setup. You must also add a Twilio SendGrid MX record to this domain's DNS records. See [**Setting up the Inbound Parse Webhook**](https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) for full instructions. The `url` represents a location where the parsed message data will be delivered. Twilio SendGrid will make an HTTP POST request to this `url` with the message data. The `url` must be publicly reachable, and your application must return a `200` status code to signal that the message data has been received. +func (c *ApiService) CreateParseSetting(params *CreateParseSettingParam) (interface{}, error) { + path := "/v3/user/webhooks/parse/settings" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.ParseSetting != nil { + b, err := json.Marshal(*params.ParseSetting) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 201 { + ps := &ParseSetting{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_delete_event_webhook.go b/rest/api/v3/webhooks/api_delete_event_webhook.go new file mode 100644 index 00000000..b503351a --- /dev/null +++ b/rest/api/v3/webhooks/api_delete_event_webhook.go @@ -0,0 +1,70 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteEventWebhookParam struct { + // The ID of the Event Webhook you want to retrieve. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteEventWebhookParam) SetId(Id string) *DeleteEventWebhookParam { + params.Id = &Id + return params +} +func (params *DeleteEventWebhookParam) SetOnbehalfof(Onbehalfof string) *DeleteEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a single Event Webhook by ID.** Unlike the [**Get an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/get-an-event-webhook) and [**Update an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) endpoints, which will operate on your oldest webhook by `created_date` when you don't provide an ID, this endpoint will return an error if you do not pass it an ID. This behavior prevents customers from unintentionally deleting a webhook. You can retrieve your webhooks' IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. ### Enable or disable the webhook This endpoint will permanently delete the webhook specified. If you instead want to disable a webhook, you can set the `enabled` property to `false` with the [**Update an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) endpoint. +func (c *ApiService) DeleteEventWebhook(params *DeleteEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/settings/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 404 { + ps := &GetSignedEventWebhook404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_delete_parse_setting.go b/rest/api/v3/webhooks/api_delete_parse_setting.go new file mode 100644 index 00000000..d5711ce9 --- /dev/null +++ b/rest/api/v3/webhooks/api_delete_parse_setting.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type DeleteParseSettingParam struct { + // The hostname associated with the inbound parse setting that you would like to retrieve. + Hostname *string `json:"hostname"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *DeleteParseSettingParam) SetHostname(Hostname string) *DeleteParseSettingParam { + params.Hostname = &Hostname + return params +} +func (params *DeleteParseSettingParam) SetOnbehalfof(Onbehalfof string) *DeleteParseSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to delete a specific inbound parse setting by hostname.** You can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint. +func (c *ApiService) DeleteParseSetting(params *DeleteParseSettingParam) (interface{}, error) { + path := "/v3/user/webhooks/parse/settings/{Hostname}" + if params != nil && params.Hostname != nil { + path = strings.Replace(path, "{"+"Hostname"+"}", *params.Hostname, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 204 { + ps := &map[string]interface{}{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_get_event_webhook.go b/rest/api/v3/webhooks/api_get_event_webhook.go new file mode 100644 index 00000000..e487f65d --- /dev/null +++ b/rest/api/v3/webhooks/api_get_event_webhook.go @@ -0,0 +1,88 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetEventWebhookParam struct { + // The ID of the Event Webhook you want to retrieve. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // Use this to include optional fields in the response payload. When this is set to `include=account_status_change`, the `account_status_change` field will be part of the response payload and set to `false` by default. See [Update an event webhook](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) for enabling this webhook notification which lets you subscribe to account status change events related to compliance action taken by SendGrid. + Include *string `json:"include,omitempty"` +} + +func (params *GetEventWebhookParam) SetId(Id string) *GetEventWebhookParam { + params.Id = &Id + return params +} +func (params *GetEventWebhookParam) SetOnbehalfof(Onbehalfof string) *GetEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *GetEventWebhookParam) SetInclude(Include string) *GetEventWebhookParam { + params.Include = &Include + return params +} + +// **This endpoint allows you to retrieve a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will return your oldest webhook by `created_date`. This means the default webhook returned by this endpoint when no ID is provided will be the first one you created. This functionality allows customers who do not have multiple webhooks to use this endpoint to retrieve their only webhook, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. ### Event settings Your webhook will be returned with all of its settings, which include the events that will be included in the POST request by the webhook and the URL where they will be sent. If an event type is marked as `true`, the event webhook will send information about that event type. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Signature verification The `public_key` property will be returned only for webhooks with signature verification enabled. ### OAuth You may share one OAuth configuration across all your webhooks or create unique credentials for each. The OAuth properties will be returned only for webhooks with OAuth configured. +func (c *ApiService) GetEventWebhook(params *GetEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/settings/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Include != nil { + data.Set("include", *params.Include) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &EventWebhookNoDatesResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetSignedEventWebhook404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_get_parse_setting.go b/rest/api/v3/webhooks/api_get_parse_setting.go new file mode 100644 index 00000000..8914ba24 --- /dev/null +++ b/rest/api/v3/webhooks/api_get_parse_setting.go @@ -0,0 +1,94 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetParseSettingParam struct { + // The hostname associated with the inbound parse setting that you would like to retrieve. + Hostname *string `json:"hostname"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetParseSettingParam) SetHostname(Hostname string) *GetParseSettingParam { + params.Hostname = &Hostname + return params +} +func (params *GetParseSettingParam) SetOnbehalfof(Onbehalfof string) *GetParseSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve a specific inbound parse setting by hostname.** You can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint. +func (c *ApiService) GetParseSetting(params *GetParseSettingParam) (interface{}, error) { + path := "/v3/user/webhooks/parse/settings/{Hostname}" + if params != nil && params.Hostname != nil { + path = strings.Replace(path, "{"+"Hostname"+"}", *params.Hostname, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ParseSetting{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_get_signed_event_webhook.go b/rest/api/v3/webhooks/api_get_signed_event_webhook.go new file mode 100644 index 00000000..27b29365 --- /dev/null +++ b/rest/api/v3/webhooks/api_get_signed_event_webhook.go @@ -0,0 +1,78 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type GetSignedEventWebhookParam struct { + // The ID of the Event Webhook you want to retrieve. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *GetSignedEventWebhookParam) SetId(Id string) *GetSignedEventWebhookParam { + params.Id = &Id + return params +} +func (params *GetSignedEventWebhookParam) SetOnbehalfof(Onbehalfof string) *GetSignedEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the public key for a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will return the public key for your oldest webhook by `created_date`. This means the default key returned by this endpoint when no ID is provided will be for the first webhook you created. This functionality allows customers who do not have multiple webhooks to use this endpoint to retrieve their only webhook's public key, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. Once you have enabled signature verification for a webhook, you will need the public key provided to verify the signatures on requests coming from Twilio SendGrid. You can use the webhook ID to [enable or disable signature verification with the endpoint dedicated for that operation](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook). For more information about cryptographically signing the Event Webhook, see [**Getting Started with the Event Webhook Security Features**](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features). +func (c *ApiService) GetSignedEventWebhook(params *GetSignedEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/settings/signed/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetSignedEventWebhook200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetSignedEventWebhook404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_list_event_webhook.go b/rest/api/v3/webhooks/api_list_event_webhook.go new file mode 100644 index 00000000..bb7dbec9 --- /dev/null +++ b/rest/api/v3/webhooks/api_list_event_webhook.go @@ -0,0 +1,69 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListEventWebhookParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // Use this to include optional fields in the response payload. When this is set to `include=account_status_change`, the `account_status_change` field will be part of the response payload and set to `false` by default. See [Update an event webhook](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) for enabling this webhook notification which lets you subscribe to account status change events related to compliance action taken by SendGrid. + Include *string `json:"include,omitempty"` +} + +func (params *ListEventWebhookParam) SetOnbehalfof(Onbehalfof string) *ListEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *ListEventWebhookParam) SetInclude(Include string) *ListEventWebhookParam { + params.Include = &Include + return params +} + +// **This endpoint allows you to retrieve all of your Event Webhooks.** Each webhook will be returned as an object in the `webhooks` array with the webhook's configuration details and ID. You can use a webhook's ID to [update the webhook's settings](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook), [delete the webhook](https://docs.sendgrid.com/api-reference/webhooks/delete-an-event-webhook), [enable or disable signature verification for the webhook](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook), and, if signature verification is enabled, [retrieve the webhook's public key](https://docs.sendgrid.com/api-reference/webhooks/get-signed-event-webhooks-public-key) when signature verification is enabled. ### Event settings Each webhook's settings determine which events will be included in the POST request by the webhook and the URL where the request will be sent. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Signature verification The `public_key` property will be returned only for webhooks with signature verification enabled. ### OAuth You may share one OAuth configuration across all your webhooks or create unique credentials for each. The OAuth properties will be returned only for webhooks with OAuth configured. +func (c *ApiService) ListEventWebhook(params *ListEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/settings/all" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Include != nil { + data.Set("include", *params.Include) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &EventWebhookAllResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_list_parse_setting.go b/rest/api/v3/webhooks/api_list_parse_setting.go new file mode 100644 index 00000000..ab066d56 --- /dev/null +++ b/rest/api/v3/webhooks/api_list_parse_setting.go @@ -0,0 +1,83 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type ListParseSettingParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListParseSettingParam) SetOnbehalfof(Onbehalfof string) *ListParseSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve all of your current inbound parse settings.** +func (c *ApiService) ListParseSetting(params *ListParseSettingParam) (interface{}, error) { + path := "/v3/user/webhooks/parse/settings" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ListParseSetting200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_list_parse_static.go b/rest/api/v3/webhooks/api_list_parse_static.go new file mode 100644 index 00000000..1fc38e96 --- /dev/null +++ b/rest/api/v3/webhooks/api_list_parse_static.go @@ -0,0 +1,106 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type ListParseStaticParam struct { + // The starting date of the statistics you want to retrieve. Must be in the format YYYY-MM-DD + StartDate *string `json:"start_date"` + // The number of statistics to return on each page. + Limit *string `json:"limit,omitempty"` + // The number of statistics to skip. + Offset *string `json:"offset,omitempty"` + // How you would like the statistics to by grouped. + AggregatedBy *AggregatedBy `json:"aggregated_by,omitempty"` + // The end date of the statistics you want to retrieve. Must be in the format YYYY-MM-DD + EndDate *string `json:"end_date,omitempty"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` +} + +func (params *ListParseStaticParam) SetStartDate(StartDate string) *ListParseStaticParam { + params.StartDate = &StartDate + return params +} +func (params *ListParseStaticParam) SetLimit(Limit string) *ListParseStaticParam { + params.Limit = &Limit + return params +} +func (params *ListParseStaticParam) SetOffset(Offset string) *ListParseStaticParam { + params.Offset = &Offset + return params +} +func (params *ListParseStaticParam) SetAggregatedBy(AggregatedBy AggregatedBy) *ListParseStaticParam { + params.AggregatedBy = &AggregatedBy + return params +} +func (params *ListParseStaticParam) SetEndDate(EndDate string) *ListParseStaticParam { + params.EndDate = &EndDate + return params +} +func (params *ListParseStaticParam) SetOnbehalfof(Onbehalfof string) *ListParseStaticParam { + params.Onbehalfof = &Onbehalfof + return params +} + +// **This endpoint allows you to retrieve the statistics for your Parse Webhook usage.** SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 30MB in size, including all attachments. There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://docs.sendgrid.com/for-developers/sending-email/libraries#webhook-libraries). +func (c *ApiService) ListParseStatic(params *ListParseStaticParam) (interface{}, error) { + path := "/v3/user/webhooks/parse/stats" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/x-www-form-urlencoded", + } + + if params != nil && params.StartDate != nil { + data.Set("start_date", *params.StartDate) + } + if params != nil && params.Limit != nil { + data.Set("limit", *params.Limit) + } + if params != nil && params.Offset != nil { + data.Set("offset", *params.Offset) + } + if params != nil && params.AggregatedBy != nil { + data.Set("aggregated_by", fmt.Sprint(*params.AggregatedBy)) + } + if params != nil && params.EndDate != nil { + data.Set("end_date", *params.EndDate) + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &[]ListParseStatic200ResponseInner{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_service.go b/rest/api/v3/webhooks/api_service.go new file mode 100644 index 00000000..a92477c0 --- /dev/null +++ b/rest/api/v3/webhooks/api_service.go @@ -0,0 +1,34 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + sendgrid "github.com/sendgrid/sendgrid-go/client" +) + +type ApiService struct { + baseURL string + requestHandler *sendgrid.RequestHandler +} + +func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService { + return &ApiService{ + requestHandler: requestHandler, + baseURL: "https://api.sendgrid.com", + } +} + +func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService { + return NewApiService(sendgrid.NewRequestHandler(client)) +} diff --git a/rest/api/v3/webhooks/api_test_event_webhook.go b/rest/api/v3/webhooks/api_test_event_webhook.go new file mode 100644 index 00000000..9a15fb2d --- /dev/null +++ b/rest/api/v3/webhooks/api_test_event_webhook.go @@ -0,0 +1,66 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" +) + +type TestEventWebhookParam struct { + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + EventWebhookTestRequest *EventWebhookTestRequest `json:"EventWebhookTestRequest,omitempty"` +} + +func (params *TestEventWebhookParam) SetOnbehalfof(Onbehalfof string) *TestEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *TestEventWebhookParam) SetEventWebhookTestRequest(EventWebhookTestRequest EventWebhookTestRequest) *TestEventWebhookParam { + params.EventWebhookTestRequest = &EventWebhookTestRequest + return params +} + +// **This endpoint allows you to test an Event Webhook.** Retry logic for this endpoint differs from other endpoints, which use a rolling 24-hour retry. This endpoint will make a POST request with a fake event notification to a URL you provide. This allows you to verify that you have properly configured the webhook before sending real data to your URL. ### Test OAuth configuration To test your OAuth configuration, you must include the necessary OAuth properties: `oauth_client_id`, `oauth_client_secret`, and `oauth_token_url`. If the webhook you are testing already has OAuth credentials saved, you will provide only the `oauth_client_id` and `oauth_token_url`—we will pull the secret for you. If you are testing a new set of OAuth credentials that have not been saved with SendGrid, you must provide all three property values. You can retrieve a previously saved `oauth_client_id` and `oauth_token_url` from the [**Get an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/get-an-event-webhook) endpoint; however, for security reasons, SendGrid will not provide your `oauth_client_secret`. +func (c *ApiService) TestEventWebhook(params *TestEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/test" + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.EventWebhookTestRequest != nil { + b, err := json.Marshal(*params.EventWebhookTestRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_update_event_webhook.go b/rest/api/v3/webhooks/api_update_event_webhook.go new file mode 100644 index 00000000..815da018 --- /dev/null +++ b/rest/api/v3/webhooks/api_update_event_webhook.go @@ -0,0 +1,110 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateEventWebhookParam struct { + // The ID of the Event Webhook you want to retrieve. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // Use this to include optional fields in the response payload. When this is set to `include=account_status_change`, the `account_status_change` field will be part of the response payload and set to `false` by default. See [Update an event webhook](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) for enabling this webhook notification which lets you subscribe to account status change events related to compliance action taken by SendGrid. + Include *string `json:"include,omitempty"` + // + EventWebhookRequest *EventWebhookRequest `json:"EventWebhookRequest,omitempty"` +} + +func (params *UpdateEventWebhookParam) SetId(Id string) *UpdateEventWebhookParam { + params.Id = &Id + return params +} +func (params *UpdateEventWebhookParam) SetOnbehalfof(Onbehalfof string) *UpdateEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateEventWebhookParam) SetInclude(Include string) *UpdateEventWebhookParam { + params.Include = &Include + return params +} +func (params *UpdateEventWebhookParam) SetEventWebhookRequest(EventWebhookRequest EventWebhookRequest) *UpdateEventWebhookParam { + params.EventWebhookRequest = &EventWebhookRequest + return params +} + +// **This endpoint allows you to update a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will update and return your oldest webhook by `created_date`. This means the default webhook updated by this endpoint when no ID is provided will be the first one you created. This functionality allows customers who do not have multiple webhooks to use this endpoint to update their only webhook, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. ### Enable or disable the webhook You can set the `enabled` property to `true` to enable the webhook or `false` to disable it. Disabling a webhook will not delete it from your account, but it will prevent the webhook from sending events to your designated URL. ### URL A webhook's URL is the endpoint where you want the webhook to send POST requests containing event data. No more than one webhook may be configured to send to the same URL. SendGrid will return an error if you attempt to set a URL for a webhook that is already in use by the user on another webhook. ### Event settings If an event type is marked as `true`, the event webhook will send information about that event type. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Webhook identifiers You may assign an optional friendly name to each of your webhooks. The friendly name is for convenience only and should not be used to programmatically differentiate your webhooks because it does not need to be unique. ### OAuth You can configure OAuth for your webhook by passing the required values to this endpoint in the `oauth_client_id`, `oauth_client_secret`, and `oauth_token_url` properties. To disable OAuth, pass an empty string to this endpoint for each of the OAuth properties. You may share one OAuth configuration across all your webhooks or create unique credentials for each. See our [webhook security documentation](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features#oauth-20) for more detailed information about OAuth and the Event Webhook. ### Signature verification Enabling signature verification for your webhook is a separate process and cannot be done with this endpoint. You can use the webhook ID to [enable or disable signature verification with the endpoint dedicated for that operation](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook). +func (c *ApiService) UpdateEventWebhook(params *UpdateEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/settings/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + if params != nil && params.Include != nil { + data.Set("include", *params.Include) + } + body := []byte{} + if params != nil && params.EventWebhookRequest != nil { + b, err := json.Marshal(*params.EventWebhookRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &EventWebhookUnsignedResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 400 { + ps := &CreateEventWebhook400Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetSignedEventWebhook404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_update_parse_setting.go b/rest/api/v3/webhooks/api_update_parse_setting.go new file mode 100644 index 00000000..96179afa --- /dev/null +++ b/rest/api/v3/webhooks/api_update_parse_setting.go @@ -0,0 +1,109 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateParseSettingParam struct { + // The hostname associated with the inbound parse setting that you would like to retrieve. + Hostname *string `json:"hostname"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + ParseSetting *ParseSetting `json:"ParseSetting,omitempty"` +} + +func (params *UpdateParseSettingParam) SetHostname(Hostname string) *UpdateParseSettingParam { + params.Hostname = &Hostname + return params +} +func (params *UpdateParseSettingParam) SetOnbehalfof(Onbehalfof string) *UpdateParseSettingParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateParseSettingParam) SetParseSetting(ParseSetting ParseSetting) *UpdateParseSettingParam { + params.ParseSetting = &ParseSetting + return params +} + +// **This endpoint allows you to update a specific inbound parse setting by hostname.** You can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint. +func (c *ApiService) UpdateParseSetting(params *UpdateParseSettingParam) (interface{}, error) { + path := "/v3/user/webhooks/parse/settings/{Hostname}" + if params != nil && params.Hostname != nil { + path = strings.Replace(path, "{"+"Hostname"+"}", *params.Hostname, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.ParseSetting != nil { + b, err := json.Marshal(*params.ParseSetting) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &ParseSetting{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 401 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 403 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &ErrorResponse{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/api_update_signed_event_webhook.go b/rest/api/v3/webhooks/api_update_signed_event_webhook.go new file mode 100644 index 00000000..7cc2f68a --- /dev/null +++ b/rest/api/v3/webhooks/api_update_signed_event_webhook.go @@ -0,0 +1,93 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "encoding/json" + "net/http" + "net/url" + + "strings" +) + +type UpdateSignedEventWebhookParam struct { + // The ID of the Event Webhook you want to retrieve. + Id *string `json:"id"` + // The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + Onbehalfof *string `json:"on-behalf-of,omitempty"` + // + UpdateSignedEventWebhookRequest *UpdateSignedEventWebhookRequest `json:"UpdateSignedEventWebhookRequest,omitempty"` +} + +func (params *UpdateSignedEventWebhookParam) SetId(Id string) *UpdateSignedEventWebhookParam { + params.Id = &Id + return params +} +func (params *UpdateSignedEventWebhookParam) SetOnbehalfof(Onbehalfof string) *UpdateSignedEventWebhookParam { + params.Onbehalfof = &Onbehalfof + return params +} +func (params *UpdateSignedEventWebhookParam) SetUpdateSignedEventWebhookRequest(UpdateSignedEventWebhookRequest UpdateSignedEventWebhookRequest) *UpdateSignedEventWebhookParam { + params.UpdateSignedEventWebhookRequest = &UpdateSignedEventWebhookRequest + return params +} + +// **This endpoint allows you to enable or disable signature verification for a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will enable signature verification for your oldest webhook by `created_date`. This means the default webhook operated on by this endpoint when no ID is provided will be the first one you created. This functionality allows customers who do not have multiple webhooks to enable or disable signature verifiction for their only webhook, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. This endpoint accepts a single boolean request property, `enabled`, that can be set `true` or `false` to enable or disable signature verification. This endpoint will return the public key required to verify Twilio SendGrid signatures if it is enabled or an empty string if signing is disabled. You can also retrieve your public key using the [**Get an Event Webhook's Public Key**](https://docs.sendgrid.com/api-reference/webhooks/get-signed-event-webhooks-public-key) endpoint. For more information about cryptographically signing the Event Webhook, see [**Getting Started with the Event Webhook Security Features**](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features). +func (c *ApiService) UpdateSignedEventWebhook(params *UpdateSignedEventWebhookParam) (interface{}, error) { + path := "/v3/user/webhooks/event/settings/signed/{Id}" + if params != nil && params.Id != nil { + path = strings.Replace(path, "{"+"Id"+"}", *params.Id, -1) + } + + data := url.Values{} + headers := map[string]interface{}{ + "Content-Type": "application/json", + } + + body := []byte{} + if params != nil && params.UpdateSignedEventWebhookRequest != nil { + b, err := json.Marshal(*params.UpdateSignedEventWebhookRequest) + if err != nil { + return nil, err + } + body = b + } + + if params != nil && params.Onbehalfof != nil { + headers["on-behalf-of"] = *params.Onbehalfof + } + resp, err := c.requestHandler.Patch(c.baseURL+path, data, headers, body...) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + if resp.StatusCode == 200 { + ps := &GetSignedEventWebhook200Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + if resp.StatusCode == 404 { + ps := &GetSignedEventWebhook404Response{} + if err := json.NewDecoder(resp.Body).Decode(ps); err != nil { + return nil, err + } + + return ps, err + } + return http.Response{StatusCode: resp.StatusCode, Body: resp.Body, Header: resp.Header}, nil +} diff --git a/rest/api/v3/webhooks/docs/AggregatedBy.md b/rest/api/v3/webhooks/docs/AggregatedBy.md new file mode 100644 index 00000000..96f02c9f --- /dev/null +++ b/rest/api/v3/webhooks/docs/AggregatedBy.md @@ -0,0 +1,14 @@ +# AggregatedBy + +## Enum + +Name | Type | Notes +------------ | ------------- | ------------- +**DAY** | string | (value: `"day"`) +**WEEK** | string | (value: `"week"`) +**MONTH** | string | (value: `"month"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/CreateEventWebhook.md b/rest/api/v3/webhooks/docs/CreateEventWebhook.md new file mode 100644 index 00000000..b14e0354 --- /dev/null +++ b/rest/api/v3/webhooks/docs/CreateEventWebhook.md @@ -0,0 +1,49 @@ +# CreateEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateEventWebhook**](CreateEventWebhook.md#CreateEventWebhook) | **Post** /v3/user/webhooks/event/settings | Create a new Event Webhook + + + +## CreateEventWebhook + +> EventWebhookUnsignedResponse CreateEventWebhook(ctx, optional) + +Create a new Event Webhook + +**This endpoint allows you to create a new Event Webhook.** When creating a webhook, you will provide a URL where you want the webhook to send POST requests, and you will select which events you want to receive in those request. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Webhook identifiers When your webhook is succesfully created, you will receive a webhook `id` in the response returned by this endpoint. You can use that ID to [update the webhook's settings](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook), [delete the webhook](https://docs.sendgrid.com/api-reference/webhooks/delete-an-event-webhook), [enable or disable signature verification for the webhook](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook), and, if signature verification is enabled, [retrieve the webhook's public key](https://docs.sendgrid.com/api-reference/webhooks/get-signed-event-webhooks-public-key). You may also assign an optional friendly name to each of your webhooks. The friendly name is for convenience only and should not be used to programmatically differentiate your webhooks because it does not need to be unique. Use the webhook ID to reliably differentiate among your webhooks. ### OAuth You can optionally configure OAuth verification for your webhook at the time of creation by passing the appropriate values in the `oauth_client_id`, `oauth_client_secret`, and `oauth_token_url` properties. You can enable or disable OAuth for the webhook after creation with the [**Update an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) operation. You may share one OAuth configuration across all your webhooks or create unique credentials for each. See our [webhook security documentation](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features#oauth-20) for details about OAuth and the Event Webhook. ### Signature verification Enabling signature verification for your webhook is a separate process and cannot be done at the time of creation with this endpoint. You can use the webhook ID to [enable or disable signature verification with the endpoint dedicated for that operation](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**EventWebhookRequest** | [**EventWebhookRequest**](EventWebhookRequest.md) | + +### Return type + +[**EventWebhookUnsignedResponse**](EventWebhookUnsignedResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/CreateEventWebhook400Response.md b/rest/api/v3/webhooks/docs/CreateEventWebhook400Response.md new file mode 100644 index 00000000..36edd9c5 --- /dev/null +++ b/rest/api/v3/webhooks/docs/CreateEventWebhook400Response.md @@ -0,0 +1,11 @@ +# CreateEventWebhook400Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]CreateEventWebhook400ResponseErrorsInner**](CreateEventWebhook400ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/CreateEventWebhook400ResponseErrorsInner.md b/rest/api/v3/webhooks/docs/CreateEventWebhook400ResponseErrorsInner.md new file mode 100644 index 00000000..d41fff3d --- /dev/null +++ b/rest/api/v3/webhooks/docs/CreateEventWebhook400ResponseErrorsInner.md @@ -0,0 +1,13 @@ +# CreateEventWebhook400ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of a Webhook that exists on your account that is already configured to send events to the endpoint URL you provided. |[optional] +**Message** | **string** | Error message. |[optional] +**Url** | **string** | The URL that is already configured as a Webhook endpoint for one of your existing Webhooks. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/CreateParseSetting.md b/rest/api/v3/webhooks/docs/CreateParseSetting.md new file mode 100644 index 00000000..75e24a9f --- /dev/null +++ b/rest/api/v3/webhooks/docs/CreateParseSetting.md @@ -0,0 +1,49 @@ +# CreateParseSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateParseSetting**](CreateParseSetting.md#CreateParseSetting) | **Post** /v3/user/webhooks/parse/settings | Create a parse setting + + + +## CreateParseSetting + +> ParseSetting CreateParseSetting(ctx, optional) + +Create a parse setting + +**This endpoint allows you to create a new inbound parse setting.** Creating an Inbound Parse setting requires two pieces of information: a `url` and a `hostname`. The `hostname` must correspond to a domain authenticated by Twilio SendGrid on your account. If you need to complete domain authentication, you can use the [Twilio SendGrid App](https://app.sendgrid.com/settings/sender_auth) or the **Authenticate a Domain** endpoint. See [**How to Set Up Domain Authentication**](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/) for instructions. Any email received by the `hostname` will be parsed when you complete this setup. You must also add a Twilio SendGrid MX record to this domain's DNS records. See [**Setting up the Inbound Parse Webhook**](https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) for full instructions. The `url` represents a location where the parsed message data will be delivered. Twilio SendGrid will make an HTTP POST request to this `url` with the message data. The `url` must be publicly reachable, and your application must return a `200` status code to signal that the message data has been received. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a CreateParseSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**ParseSetting** | [**ParseSetting**](ParseSetting.md) | + +### Return type + +[**ParseSetting**](ParseSetting.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/DeleteEventWebhook.md b/rest/api/v3/webhooks/docs/DeleteEventWebhook.md new file mode 100644 index 00000000..135249c7 --- /dev/null +++ b/rest/api/v3/webhooks/docs/DeleteEventWebhook.md @@ -0,0 +1,52 @@ +# DeleteEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteEventWebhook**](DeleteEventWebhook.md#DeleteEventWebhook) | **Delete** /v3/user/webhooks/event/settings/{Id} | Delete a single Event Webhook by ID. + + + +## DeleteEventWebhook + +> DeleteEventWebhook(ctx, Idoptional) + +Delete a single Event Webhook by ID. + +**This endpoint allows you to delete a single Event Webhook by ID.** Unlike the [**Get an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/get-an-event-webhook) and [**Update an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) endpoints, which will operate on your oldest webhook by `created_date` when you don't provide an ID, this endpoint will return an error if you do not pass it an ID. This behavior prevents customers from unintentionally deleting a webhook. You can retrieve your webhooks' IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. ### Enable or disable the webhook This endpoint will permanently delete the webhook specified. If you instead want to disable a webhook, you can set the `enabled` property to `false` with the [**Update an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Event Webhook you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/DeleteParseSetting.md b/rest/api/v3/webhooks/docs/DeleteParseSetting.md new file mode 100644 index 00000000..5bdf1dc3 --- /dev/null +++ b/rest/api/v3/webhooks/docs/DeleteParseSetting.md @@ -0,0 +1,52 @@ +# DeleteParseSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteParseSetting**](DeleteParseSetting.md#DeleteParseSetting) | **Delete** /v3/user/webhooks/parse/settings/{Hostname} | Delete a parse setting + + + +## DeleteParseSetting + +> map[string]interface{} DeleteParseSetting(ctx, Hostnameoptional) + +Delete a parse setting + +**This endpoint allows you to delete a specific inbound parse setting by hostname.** You can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Hostname** | **string** | The hostname associated with the inbound parse setting that you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a DeleteParseSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +**map[string]interface{}** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/ErrorResponse.md b/rest/api/v3/webhooks/docs/ErrorResponse.md new file mode 100644 index 00000000..ec2d41f6 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ErrorResponse.md @@ -0,0 +1,12 @@ +# ErrorResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]ErrorResponseErrorsInner**](ErrorResponseErrorsInner.md) | |[optional] +**Id** | **string** | When applicable, this property value will be an error ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/ErrorResponseErrorsInner.md b/rest/api/v3/webhooks/docs/ErrorResponseErrorsInner.md new file mode 100644 index 00000000..5449c685 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,13 @@ +# ErrorResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | An error message. |[optional] +**Field** | **string** | When applicable, this property value will be the field that generated the error. |[optional] +**Help** | **map[string]interface{}** | When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookAllResponse.md b/rest/api/v3/webhooks/docs/EventWebhookAllResponse.md new file mode 100644 index 00000000..fd85723d --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookAllResponse.md @@ -0,0 +1,12 @@ +# EventWebhookAllResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MaxAllowed** | **float32** | The maximum number of Event Webhooks you can have enabled under your current Twilio SendGrid plan. See the [Twilio SendGrid pricing page](https://sendgrid.com/pricing) for more information about the features available with each plan. |[optional] +**Webhooks** | [**[]EventWebhookSignedResponse**](EventWebhookSignedResponse.md) | An array of Event Webhook objects. Each object represents one of your webhooks and contains its configuration settings, including which events it is set to send in the POST request, the URL where it will send those events, and the webhook's ID. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookBaseResponseProps.md b/rest/api/v3/webhooks/docs/EventWebhookBaseResponseProps.md new file mode 100644 index 00000000..31b021d3 --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookBaseResponseProps.md @@ -0,0 +1,26 @@ +# EventWebhookBaseResponseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the Event Webhook is enabled. |[optional] +**Url** | **string** | The URL where SendGrid will send event data. |[optional] +**AccountStatusChange** | **bool** | Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. |[optional] +**GroupResubscribe** | **bool** | Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Delivered** | **bool** | Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. |[optional] +**GroupUnsubscribe** | **bool** | Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**SpamReport** | **bool** | Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. |[optional] +**Bounce** | **bool** | Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. |[optional] +**Deferred** | **bool** | Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. |[optional] +**Unsubscribe** | **bool** | Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Processed** | **bool** | Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. |[optional] +**Open** | **bool** | Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. |[optional] +**Click** | **bool** | Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. |[optional] +**Dropped** | **bool** | Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. |[optional] +**FriendlyName** | **string** | An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. |[optional] +**Id** | **string** | A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookDateResponseProps.md b/rest/api/v3/webhooks/docs/EventWebhookDateResponseProps.md new file mode 100644 index 00000000..e6c48f23 --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookDateResponseProps.md @@ -0,0 +1,12 @@ +# EventWebhookDateResponseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedDate** | [**time.Time**](time.Time.md) | An ISO 8601 timestamp in UTC timezone when the Event Webhook was created. If a Webhook's `created_date` is `null`, it is a [legacy Event Webook](https://www.twilio.com/en-us/changelog/event-webhooks), which means it is your oldest Webhook. |[optional] +**UpdatedDate** | [**time.Time**](time.Time.md) | An ISO 8601 timestamp in UTC timezone when the Event Webhook was last modified. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookNoDatesResponse.md b/rest/api/v3/webhooks/docs/EventWebhookNoDatesResponse.md new file mode 100644 index 00000000..3da1ae81 --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookNoDatesResponse.md @@ -0,0 +1,29 @@ +# EventWebhookNoDatesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the Event Webhook is enabled. |[optional] +**Url** | **string** | The URL where SendGrid will send event data. |[optional] +**AccountStatusChange** | **bool** | Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. |[optional] +**GroupResubscribe** | **bool** | Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Delivered** | **bool** | Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. |[optional] +**GroupUnsubscribe** | **bool** | Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**SpamReport** | **bool** | Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. |[optional] +**Bounce** | **bool** | Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. |[optional] +**Deferred** | **bool** | Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. |[optional] +**Unsubscribe** | **bool** | Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Processed** | **bool** | Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. |[optional] +**Open** | **bool** | Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. |[optional] +**Click** | **bool** | Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. |[optional] +**Dropped** | **bool** | Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. |[optional] +**FriendlyName** | **string** | An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. |[optional] +**Id** | **string** | A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. |[optional] +**OauthClientId** | **string** | The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. |[optional] +**OauthTokenUrl** | **string** | The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. |[optional] +**PublicKey** | **string** | The public key you can use to verify the SendGrid signature. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookOauthResponseProps.md b/rest/api/v3/webhooks/docs/EventWebhookOauthResponseProps.md new file mode 100644 index 00000000..fc98cdca --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookOauthResponseProps.md @@ -0,0 +1,12 @@ +# EventWebhookOauthResponseProps + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OauthClientId** | **string** | The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. |[optional] +**OauthTokenUrl** | **string** | The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookRequest.md b/rest/api/v3/webhooks/docs/EventWebhookRequest.md new file mode 100644 index 00000000..26906ee3 --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookRequest.md @@ -0,0 +1,27 @@ +# EventWebhookRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Set this property to `true` to enable the Event Webhook or `false` to disable it. |[optional] +**Url** | **string** | Set this property to the URL where you want the Event Webhook to send event data. | +**GroupResubscribe** | **bool** | Set this property to `true` to receive group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Delivered** | **bool** | Set this property to `true` to receive delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. |[optional] +**GroupUnsubscribe** | **bool** | Set this property to `true` to receive group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**SpamReport** | **bool** | Set this property to `true` to receive spam report events. Spam reports occur when recipients mark a message as spam. |[optional] +**Bounce** | **bool** | Set this property to `true` to receive bounce events. A bounce occurs when a receiving server could not or would not accept a message. |[optional] +**Deferred** | **bool** | Set this property to `true` to receive deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. |[optional] +**Unsubscribe** | **bool** | Set this property to `true` to receive unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Processed** | **bool** | Set this property to `true` to receive processed events. Processed events occur when a message has been received by Twilio SendGrid and the message is ready to be delivered. |[optional] +**Open** | **bool** | Set this property to `true` to receive open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. |[optional] +**Click** | **bool** | Set this property to `true` to receive click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. |[optional] +**Dropped** | **bool** | Set this property to `true` to receive dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. |[optional] +**FriendlyName** | **string** | Optionally set this property to a friendly name for the Event Webhook. A friendly name may be assigned to each of your webhooks to help you differentiate them. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. |[optional] +**OauthClientId** | **string** | Set this property to the OAuth client ID that SendGrid will pass to your OAuth server or service provider to generate an OAuth access token. When passing data in this property, you must also include the `oauth_token_url` property. |[optional] +**OauthClientSecret** | **string** | Set this property to the OAuth client secret that SendGrid will pass to your OAuth server or service provider to generate an OAuth access token. This secret is needed only once to create an access token. SendGrid will store the secret, allowing you to update your client ID and Token URL without passing the secret to SendGrid again. When passing data in this field, you must also include the `oauth_client_id` and `oauth_token_url` properties. |[optional] +**OauthTokenUrl** | **string** | Set this property to the URL where SendGrid will send the OAuth client ID and client secret to generate an OAuth access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the `oauth_client_id` property. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookSignedResponse.md b/rest/api/v3/webhooks/docs/EventWebhookSignedResponse.md new file mode 100644 index 00000000..089b485e --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookSignedResponse.md @@ -0,0 +1,31 @@ +# EventWebhookSignedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the Event Webhook is enabled. |[optional] +**Url** | **string** | The URL where SendGrid will send event data. |[optional] +**AccountStatusChange** | **bool** | Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. |[optional] +**GroupResubscribe** | **bool** | Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Delivered** | **bool** | Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. |[optional] +**GroupUnsubscribe** | **bool** | Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**SpamReport** | **bool** | Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. |[optional] +**Bounce** | **bool** | Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. |[optional] +**Deferred** | **bool** | Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. |[optional] +**Unsubscribe** | **bool** | Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Processed** | **bool** | Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. |[optional] +**Open** | **bool** | Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. |[optional] +**Click** | **bool** | Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. |[optional] +**Dropped** | **bool** | Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. |[optional] +**FriendlyName** | **string** | An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. |[optional] +**Id** | **string** | A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. |[optional] +**CreatedDate** | [**time.Time**](time.Time.md) | An ISO 8601 timestamp in UTC timezone when the Event Webhook was created. If a Webhook's `created_date` is `null`, it is a [legacy Event Webook](https://www.twilio.com/en-us/changelog/event-webhooks), which means it is your oldest Webhook. |[optional] +**UpdatedDate** | [**time.Time**](time.Time.md) | An ISO 8601 timestamp in UTC timezone when the Event Webhook was last modified. |[optional] +**OauthClientId** | **string** | The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. |[optional] +**OauthTokenUrl** | **string** | The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. |[optional] +**PublicKey** | **string** | The public key you can use to verify the SendGrid signature. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookSignedResponseProp.md b/rest/api/v3/webhooks/docs/EventWebhookSignedResponseProp.md new file mode 100644 index 00000000..dfdae0d7 --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookSignedResponseProp.md @@ -0,0 +1,11 @@ +# EventWebhookSignedResponseProp + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PublicKey** | **string** | The public key you can use to verify the SendGrid signature. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookTestRequest.md b/rest/api/v3/webhooks/docs/EventWebhookTestRequest.md new file mode 100644 index 00000000..f09ac2de --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookTestRequest.md @@ -0,0 +1,15 @@ +# EventWebhookTestRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of the Event Webhook you want to retrieve. |[optional] +**Url** | **string** | The URL where you would like the test notification to be sent. | +**OauthClientId** | **string** | The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this property, you must also include the `oauth_token_url` property. |[optional] +**OauthClientSecret** | **string** | The `oauth_client_secret` is needed only once to create an access token. SendGrid will store this secret, allowing you to update your Client ID and Token URL without passing the secret to SendGrid again. When passing data in this field, you must also include the `oauth_client_id` and `oauth_token_url` properties. |[optional] +**OauthTokenUrl** | **string** | The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the `oauth_client_id` property. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/EventWebhookUnsignedResponse.md b/rest/api/v3/webhooks/docs/EventWebhookUnsignedResponse.md new file mode 100644 index 00000000..e2e3a0d8 --- /dev/null +++ b/rest/api/v3/webhooks/docs/EventWebhookUnsignedResponse.md @@ -0,0 +1,30 @@ +# EventWebhookUnsignedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Indicates if the Event Webhook is enabled. |[optional] +**Url** | **string** | The URL where SendGrid will send event data. |[optional] +**AccountStatusChange** | **bool** | Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. |[optional] +**GroupResubscribe** | **bool** | Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Delivered** | **bool** | Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. |[optional] +**GroupUnsubscribe** | **bool** | Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**SpamReport** | **bool** | Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. |[optional] +**Bounce** | **bool** | Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. |[optional] +**Deferred** | **bool** | Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. |[optional] +**Unsubscribe** | **bool** | Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. |[optional] +**Processed** | **bool** | Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. |[optional] +**Open** | **bool** | Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. |[optional] +**Click** | **bool** | Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. |[optional] +**Dropped** | **bool** | Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. |[optional] +**FriendlyName** | **string** | An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. |[optional] +**Id** | **string** | A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. |[optional] +**CreatedDate** | [**time.Time**](time.Time.md) | An ISO 8601 timestamp in UTC timezone when the Event Webhook was created. If a Webhook's `created_date` is `null`, it is a [legacy Event Webook](https://www.twilio.com/en-us/changelog/event-webhooks), which means it is your oldest Webhook. |[optional] +**UpdatedDate** | [**time.Time**](time.Time.md) | An ISO 8601 timestamp in UTC timezone when the Event Webhook was last modified. |[optional] +**OauthClientId** | **string** | The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. |[optional] +**OauthTokenUrl** | **string** | The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/GetEventWebhook.md b/rest/api/v3/webhooks/docs/GetEventWebhook.md new file mode 100644 index 00000000..db760440 --- /dev/null +++ b/rest/api/v3/webhooks/docs/GetEventWebhook.md @@ -0,0 +1,53 @@ +# GetEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetEventWebhook**](GetEventWebhook.md#GetEventWebhook) | **Get** /v3/user/webhooks/event/settings/{Id} | Get the settings for a single Event Webhook. + + + +## GetEventWebhook + +> EventWebhookNoDatesResponse GetEventWebhook(ctx, Idoptional) + +Get the settings for a single Event Webhook. + +**This endpoint allows you to retrieve a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will return your oldest webhook by `created_date`. This means the default webhook returned by this endpoint when no ID is provided will be the first one you created. This functionality allows customers who do not have multiple webhooks to use this endpoint to retrieve their only webhook, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. ### Event settings Your webhook will be returned with all of its settings, which include the events that will be included in the POST request by the webhook and the URL where they will be sent. If an event type is marked as `true`, the event webhook will send information about that event type. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Signature verification The `public_key` property will be returned only for webhooks with signature verification enabled. ### OAuth You may share one OAuth configuration across all your webhooks or create unique credentials for each. The OAuth properties will be returned only for webhooks with OAuth configured. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Event Webhook you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Include** | **string** | Use this to include optional fields in the response payload. When this is set to `include=account_status_change`, the `account_status_change` field will be part of the response payload and set to `false` by default. See [Update an event webhook](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) for enabling this webhook notification which lets you subscribe to account status change events related to compliance action taken by SendGrid. + +### Return type + +[**EventWebhookNoDatesResponse**](EventWebhookNoDatesResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/GetParseSetting.md b/rest/api/v3/webhooks/docs/GetParseSetting.md new file mode 100644 index 00000000..7350f622 --- /dev/null +++ b/rest/api/v3/webhooks/docs/GetParseSetting.md @@ -0,0 +1,52 @@ +# GetParseSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetParseSetting**](GetParseSetting.md#GetParseSetting) | **Get** /v3/user/webhooks/parse/settings/{Hostname} | Retrieve a specific parse setting + + + +## GetParseSetting + +> ParseSetting GetParseSetting(ctx, Hostnameoptional) + +Retrieve a specific parse setting + +**This endpoint allows you to retrieve a specific inbound parse setting by hostname.** You can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Hostname** | **string** | The hostname associated with the inbound parse setting that you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetParseSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ParseSetting**](ParseSetting.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/GetSignedEventWebhook.md b/rest/api/v3/webhooks/docs/GetSignedEventWebhook.md new file mode 100644 index 00000000..bef22a2c --- /dev/null +++ b/rest/api/v3/webhooks/docs/GetSignedEventWebhook.md @@ -0,0 +1,52 @@ +# GetSignedEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetSignedEventWebhook**](GetSignedEventWebhook.md#GetSignedEventWebhook) | **Get** /v3/user/webhooks/event/settings/signed/{Id} | Get Signed Event Webhook's Public Key + + + +## GetSignedEventWebhook + +> GetSignedEventWebhook200Response GetSignedEventWebhook(ctx, Idoptional) + +Get Signed Event Webhook's Public Key + +**This endpoint allows you to retrieve the public key for a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will return the public key for your oldest webhook by `created_date`. This means the default key returned by this endpoint when no ID is provided will be for the first webhook you created. This functionality allows customers who do not have multiple webhooks to use this endpoint to retrieve their only webhook's public key, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. Once you have enabled signature verification for a webhook, you will need the public key provided to verify the signatures on requests coming from Twilio SendGrid. You can use the webhook ID to [enable or disable signature verification with the endpoint dedicated for that operation](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook). For more information about cryptographically signing the Event Webhook, see [**Getting Started with the Event Webhook Security Features**](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Event Webhook you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a GetSignedEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**GetSignedEventWebhook200Response**](GetSignedEventWebhook200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/GetSignedEventWebhook200Response.md b/rest/api/v3/webhooks/docs/GetSignedEventWebhook200Response.md new file mode 100644 index 00000000..d6c88517 --- /dev/null +++ b/rest/api/v3/webhooks/docs/GetSignedEventWebhook200Response.md @@ -0,0 +1,12 @@ +# GetSignedEventWebhook200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. |[optional] +**PublicKey** | **string** | The public key you can use to verify the Twilio SendGrid signature. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/GetSignedEventWebhook404Response.md b/rest/api/v3/webhooks/docs/GetSignedEventWebhook404Response.md new file mode 100644 index 00000000..61619203 --- /dev/null +++ b/rest/api/v3/webhooks/docs/GetSignedEventWebhook404Response.md @@ -0,0 +1,11 @@ +# GetSignedEventWebhook404Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | [**[]GetSignedEventWebhook404ResponseErrorsInner**](GetSignedEventWebhook404ResponseErrorsInner.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/GetSignedEventWebhook404ResponseErrorsInner.md b/rest/api/v3/webhooks/docs/GetSignedEventWebhook404ResponseErrorsInner.md new file mode 100644 index 00000000..4dc38426 --- /dev/null +++ b/rest/api/v3/webhooks/docs/GetSignedEventWebhook404ResponseErrorsInner.md @@ -0,0 +1,11 @@ +# GetSignedEventWebhook404ResponseErrorsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Message** | **string** | Error message. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/ListEventWebhook.md b/rest/api/v3/webhooks/docs/ListEventWebhook.md new file mode 100644 index 00000000..d6193762 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ListEventWebhook.md @@ -0,0 +1,49 @@ +# ListEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListEventWebhook**](ListEventWebhook.md#ListEventWebhook) | **Get** /v3/user/webhooks/event/settings/all | Retrieve all of your Event Webhooks. + + + +## ListEventWebhook + +> EventWebhookAllResponse ListEventWebhook(ctx, optional) + +Retrieve all of your Event Webhooks. + +**This endpoint allows you to retrieve all of your Event Webhooks.** Each webhook will be returned as an object in the `webhooks` array with the webhook's configuration details and ID. You can use a webhook's ID to [update the webhook's settings](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook), [delete the webhook](https://docs.sendgrid.com/api-reference/webhooks/delete-an-event-webhook), [enable or disable signature verification for the webhook](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook), and, if signature verification is enabled, [retrieve the webhook's public key](https://docs.sendgrid.com/api-reference/webhooks/get-signed-event-webhooks-public-key) when signature verification is enabled. ### Event settings Each webhook's settings determine which events will be included in the POST request by the webhook and the URL where the request will be sent. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Signature verification The `public_key` property will be returned only for webhooks with signature verification enabled. ### OAuth You may share one OAuth configuration across all your webhooks or create unique credentials for each. The OAuth properties will be returned only for webhooks with OAuth configured. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Include** | **string** | Use this to include optional fields in the response payload. When this is set to `include=account_status_change`, the `account_status_change` field will be part of the response payload and set to `false` by default. See [Update an event webhook](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) for enabling this webhook notification which lets you subscribe to account status change events related to compliance action taken by SendGrid. + +### Return type + +[**EventWebhookAllResponse**](EventWebhookAllResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/ListParseSetting.md b/rest/api/v3/webhooks/docs/ListParseSetting.md new file mode 100644 index 00000000..919d1c50 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ListParseSetting.md @@ -0,0 +1,48 @@ +# ListParseSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListParseSetting**](ListParseSetting.md#ListParseSetting) | **Get** /v3/user/webhooks/parse/settings | Retrieve all parse settings + + + +## ListParseSetting + +> ListParseSetting200Response ListParseSetting(ctx, optional) + +Retrieve all parse settings + +**This endpoint allows you to retrieve all of your current inbound parse settings.** + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListParseSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**ListParseSetting200Response**](ListParseSetting200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/ListParseSetting200Response.md b/rest/api/v3/webhooks/docs/ListParseSetting200Response.md new file mode 100644 index 00000000..b6777bb0 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ListParseSetting200Response.md @@ -0,0 +1,11 @@ +# ListParseSetting200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Result** | [**[]ParseSetting**](ParseSetting.md) | The list of your current inbound parse settings. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/ListParseStatic.md b/rest/api/v3/webhooks/docs/ListParseStatic.md new file mode 100644 index 00000000..7da90539 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ListParseStatic.md @@ -0,0 +1,52 @@ +# ListParseStatic + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListParseStatic**](ListParseStatic.md#ListParseStatic) | **Get** /v3/user/webhooks/parse/stats | Retrieves Inbound Parse Webhook statistics. + + + +## ListParseStatic + +> []ListParseStatic200ResponseInner ListParseStatic(ctx, StartDateoptional) + +Retrieves Inbound Parse Webhook statistics. + +**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.** SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 30MB in size, including all attachments. There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://docs.sendgrid.com/for-developers/sending-email/libraries#webhook-libraries). + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a ListParseStaticParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Limit** | **string** | The number of statistics to return on each page. +**Offset** | **string** | The number of statistics to skip. +**AggregatedBy** | [**AggregatedBy**](AggregatedByAggregatedBy.md) | How you would like the statistics to by grouped. +**EndDate** | **string** | The end date of the statistics you want to retrieve. Must be in the format YYYY-MM-DD +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. + +### Return type + +[**[]ListParseStatic200ResponseInner**](ListParseStatic200ResponseInner.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInner.md b/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInner.md new file mode 100644 index 00000000..71c9d470 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInner.md @@ -0,0 +1,12 @@ +# ListParseStatic200ResponseInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Date** | **string** | The date that the stats were collected. | +**Stats** | [**[]ListParseStatic200ResponseInnerStatsInner**](ListParseStatic200ResponseInnerStatsInner.md) | The Parse Webhook usage statistics. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInner.md b/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInner.md new file mode 100644 index 00000000..31d9441c --- /dev/null +++ b/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInner.md @@ -0,0 +1,11 @@ +# ListParseStatic200ResponseInnerStatsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metrics** | [**ListParseStatic200ResponseInnerStatsInnerMetrics**](ListParseStatic200ResponseInnerStatsInnerMetrics.md) | |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInnerMetrics.md b/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInnerMetrics.md new file mode 100644 index 00000000..a0648924 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ListParseStatic200ResponseInnerStatsInnerMetrics.md @@ -0,0 +1,11 @@ +# ListParseStatic200ResponseInnerStatsInnerMetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Received** | **float32** | The number of emails received and parsed by the Parse Webhook. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/ParseSetting.md b/rest/api/v3/webhooks/docs/ParseSetting.md new file mode 100644 index 00000000..344e4bf8 --- /dev/null +++ b/rest/api/v3/webhooks/docs/ParseSetting.md @@ -0,0 +1,14 @@ +# ParseSetting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | The public URL where you would like SendGrid to POST the data parsed from your email. Any emails sent with the given hostname provided (whose MX records have been updated to point to SendGrid) will be parsed and POSTed to this URL. |[optional] +**Hostname** | **string** | A specific and unique domain or subdomain that you have created to use exclusively to parse your incoming email. For example, `parse.yourdomain.com`. |[optional] +**SpamCheck** | **bool** | Indicates if you would like SendGrid to check the content parsed from your emails for spam before POSTing them to your domain. |[optional] +**SendRaw** | **bool** | Indicates if you would like SendGrid to post the original MIME-type content of your parsed email. When this parameter is set to `true`, SendGrid will send a JSON payload of the content of your email. |[optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/docs/TestEventWebhook.md b/rest/api/v3/webhooks/docs/TestEventWebhook.md new file mode 100644 index 00000000..86581df0 --- /dev/null +++ b/rest/api/v3/webhooks/docs/TestEventWebhook.md @@ -0,0 +1,49 @@ +# TestEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestEventWebhook**](TestEventWebhook.md#TestEventWebhook) | **Post** /v3/user/webhooks/event/test | Test an Event Webhook's settings + + + +## TestEventWebhook + +> TestEventWebhook(ctx, optional) + +Test an Event Webhook's settings + +**This endpoint allows you to test an Event Webhook.** Retry logic for this endpoint differs from other endpoints, which use a rolling 24-hour retry. This endpoint will make a POST request with a fake event notification to a URL you provide. This allows you to verify that you have properly configured the webhook before sending real data to your URL. ### Test OAuth configuration To test your OAuth configuration, you must include the necessary OAuth properties: `oauth_client_id`, `oauth_client_secret`, and `oauth_token_url`. If the webhook you are testing already has OAuth credentials saved, you will provide only the `oauth_client_id` and `oauth_token_url`—we will pull the secret for you. If you are testing a new set of OAuth credentials that have not been saved with SendGrid, you must provide all three property values. You can retrieve a previously saved `oauth_client_id` and `oauth_token_url` from the [**Get an Event Webhook**](https://docs.sendgrid.com/api-reference/webhooks/get-an-event-webhook) endpoint; however, for security reasons, SendGrid will not provide your `oauth_client_secret`. + +### Path Parameters + +This endpoint does not need any path parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a TestEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**EventWebhookTestRequest** | [**EventWebhookTestRequest**](EventWebhookTestRequest.md) | + +### Return type + + (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/UpdateEventWebhook.md b/rest/api/v3/webhooks/docs/UpdateEventWebhook.md new file mode 100644 index 00000000..005976c1 --- /dev/null +++ b/rest/api/v3/webhooks/docs/UpdateEventWebhook.md @@ -0,0 +1,54 @@ +# UpdateEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateEventWebhook**](UpdateEventWebhook.md#UpdateEventWebhook) | **Patch** /v3/user/webhooks/event/settings/{Id} | Update a single Event Webhook by ID. + + + +## UpdateEventWebhook + +> EventWebhookUnsignedResponse UpdateEventWebhook(ctx, Idoptional) + +Update a single Event Webhook by ID. + +**This endpoint allows you to update a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will update and return your oldest webhook by `created_date`. This means the default webhook updated by this endpoint when no ID is provided will be the first one you created. This functionality allows customers who do not have multiple webhooks to use this endpoint to update their only webhook, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. ### Enable or disable the webhook You can set the `enabled` property to `true` to enable the webhook or `false` to disable it. Disabling a webhook will not delete it from your account, but it will prevent the webhook from sending events to your designated URL. ### URL A webhook's URL is the endpoint where you want the webhook to send POST requests containing event data. No more than one webhook may be configured to send to the same URL. SendGrid will return an error if you attempt to set a URL for a webhook that is already in use by the user on another webhook. ### Event settings If an event type is marked as `true`, the event webhook will send information about that event type. See the [**Event Webhook Reference**](https://docs.sendgrid.com/for-developers/tracking-events/event#delivery-events) for details about each event type. ### Webhook identifiers You may assign an optional friendly name to each of your webhooks. The friendly name is for convenience only and should not be used to programmatically differentiate your webhooks because it does not need to be unique. ### OAuth You can configure OAuth for your webhook by passing the required values to this endpoint in the `oauth_client_id`, `oauth_client_secret`, and `oauth_token_url` properties. To disable OAuth, pass an empty string to this endpoint for each of the OAuth properties. You may share one OAuth configuration across all your webhooks or create unique credentials for each. See our [webhook security documentation](https://docs.sendgrid.com/for-developers/tracking-events/getting-started-event-webhook-security-features#oauth-20) for more detailed information about OAuth and the Event Webhook. ### Signature verification Enabling signature verification for your webhook is a separate process and cannot be done with this endpoint. You can use the webhook ID to [enable or disable signature verification with the endpoint dedicated for that operation](https://docs.sendgrid.com/api-reference/webhooks/toggle-signature-verification-for-an-event-webhook). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Event Webhook you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**Include** | **string** | Use this to include optional fields in the response payload. When this is set to `include=account_status_change`, the `account_status_change` field will be part of the response payload and set to `false` by default. See [Update an event webhook](https://docs.sendgrid.com/api-reference/webhooks/update-an-event-webhook) for enabling this webhook notification which lets you subscribe to account status change events related to compliance action taken by SendGrid. +**EventWebhookRequest** | [**EventWebhookRequest**](EventWebhookRequest.md) | + +### Return type + +[**EventWebhookUnsignedResponse**](EventWebhookUnsignedResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/UpdateParseSetting.md b/rest/api/v3/webhooks/docs/UpdateParseSetting.md new file mode 100644 index 00000000..ae9e970e --- /dev/null +++ b/rest/api/v3/webhooks/docs/UpdateParseSetting.md @@ -0,0 +1,53 @@ +# UpdateParseSetting + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateParseSetting**](UpdateParseSetting.md#UpdateParseSetting) | **Patch** /v3/user/webhooks/parse/settings/{Hostname} | Update a parse setting + + + +## UpdateParseSetting + +> ParseSetting UpdateParseSetting(ctx, Hostnameoptional) + +Update a parse setting + +**This endpoint allows you to update a specific inbound parse setting by hostname.** You can retrieve all your Inbound Parse settings and their associated host names with the \"Retrieve all parse settings\" endpoint. + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Hostname** | **string** | The hostname associated with the inbound parse setting that you would like to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateParseSettingParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**ParseSetting** | [**ParseSetting**](ParseSetting.md) | + +### Return type + +[**ParseSetting**](ParseSetting.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/UpdateSignedEventWebhook.md b/rest/api/v3/webhooks/docs/UpdateSignedEventWebhook.md new file mode 100644 index 00000000..8fa6e5d7 --- /dev/null +++ b/rest/api/v3/webhooks/docs/UpdateSignedEventWebhook.md @@ -0,0 +1,53 @@ +# UpdateSignedEventWebhook + +All URIs are relative to *https://api.sendgrid.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateSignedEventWebhook**](UpdateSignedEventWebhook.md#UpdateSignedEventWebhook) | **Patch** /v3/user/webhooks/event/settings/signed/{Id} | Toggle signature verification for a single Event Webhook by ID + + + +## UpdateSignedEventWebhook + +> GetSignedEventWebhook200Response UpdateSignedEventWebhook(ctx, Idoptional) + +Toggle signature verification for a single Event Webhook by ID + +**This endpoint allows you to enable or disable signature verification for a single Event Webhook by ID.** If you do not pass a webhook ID to this endpoint, it will enable signature verification for your oldest webhook by `created_date`. This means the default webhook operated on by this endpoint when no ID is provided will be the first one you created. This functionality allows customers who do not have multiple webhooks to enable or disable signature verifiction for their only webhook, even if they do not supply an ID. If you have multiple webhooks, you can retrieve their IDs using the [**Get All Event Webhooks**](https://docs.sendgrid.com/api-reference/webhooks/get-all-event-webhooks) endpoint. This endpoint accepts a single boolean request property, `enabled`, that can be set `true` or `false` to enable or disable signature verification. This endpoint will return the public key required to verify Twilio SendGrid signatures if it is enabled or an empty string if signing is disabled. You can also retrieve your public key using the [**Get an Event Webhook's Public Key**](https://docs.sendgrid.com/api-reference/webhooks/get-signed-event-webhooks-public-key) endpoint. For more information about cryptographically signing the Event Webhook, see [**Getting Started with the Event Webhook Security Features**](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features). + +### Path Parameters + + +Name | Type | Description +------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**Id** | **string** | The ID of the Event Webhook you want to retrieve. + +### Other Parameters + +Other parameters are passed through a pointer to a UpdateSignedEventWebhookParams struct + + +Name | Type | Description +------------- | ------------- | ------------- +**Onbehalfof** | **string** | The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id `). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: `). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information. +**UpdateSignedEventWebhookRequest** | [**UpdateSignedEventWebhookRequest**](UpdateSignedEventWebhookRequest.md) | + +### Return type + +[**GetSignedEventWebhook200Response**](GetSignedEventWebhook200Response.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/rest/api/v3/webhooks/docs/UpdateSignedEventWebhookRequest.md b/rest/api/v3/webhooks/docs/UpdateSignedEventWebhookRequest.md new file mode 100644 index 00000000..d2364a21 --- /dev/null +++ b/rest/api/v3/webhooks/docs/UpdateSignedEventWebhookRequest.md @@ -0,0 +1,11 @@ +# UpdateSignedEventWebhookRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Enable or disable the webhook by setting this property to `true` or `false`, respectively. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rest/api/v3/webhooks/model_aggregated_by.go b/rest/api/v3/webhooks/model_aggregated_by.go new file mode 100644 index 00000000..32a394b9 --- /dev/null +++ b/rest/api/v3/webhooks/model_aggregated_by.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// AggregatedBy the model 'AggregatedBy' +type AggregatedBy string + +// List of AggregatedBy +const ( + AGGREGATEDBY_DAY AggregatedBy = "day" + AGGREGATEDBY_WEEK AggregatedBy = "week" + AGGREGATEDBY_MONTH AggregatedBy = "month" +) diff --git a/rest/api/v3/webhooks/model_create_event_webhook_400_response.go b/rest/api/v3/webhooks/model_create_event_webhook_400_response.go new file mode 100644 index 00000000..d6e50ac2 --- /dev/null +++ b/rest/api/v3/webhooks/model_create_event_webhook_400_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateEventWebhook400Response struct for CreateEventWebhook400Response +type CreateEventWebhook400Response struct { + Errors *[]CreateEventWebhook400ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_create_event_webhook_400_response_errors_inner.go b/rest/api/v3/webhooks/model_create_event_webhook_400_response_errors_inner.go new file mode 100644 index 00000000..74a5296f --- /dev/null +++ b/rest/api/v3/webhooks/model_create_event_webhook_400_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// CreateEventWebhook400ResponseErrorsInner struct for CreateEventWebhook400ResponseErrorsInner +type CreateEventWebhook400ResponseErrorsInner struct { + // The ID of a Webhook that exists on your account that is already configured to send events to the endpoint URL you provided. + Id *string `json:"id,omitempty"` + // Error message. + Message *string `json:"message,omitempty"` + // The URL that is already configured as a Webhook endpoint for one of your existing Webhooks. + Url *string `json:"url,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_error_response.go b/rest/api/v3/webhooks/model_error_response.go new file mode 100644 index 00000000..ee43ea98 --- /dev/null +++ b/rest/api/v3/webhooks/model_error_response.go @@ -0,0 +1,21 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponse struct for ErrorResponse +type ErrorResponse struct { + Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"` + // When applicable, this property value will be an error ID. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_error_response_errors_inner.go b/rest/api/v3/webhooks/model_error_response_errors_inner.go new file mode 100644 index 00000000..a946dccd --- /dev/null +++ b/rest/api/v3/webhooks/model_error_response_errors_inner.go @@ -0,0 +1,24 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ErrorResponseErrorsInner struct for ErrorResponseErrorsInner +type ErrorResponseErrorsInner struct { + // An error message. + Message *string `json:"message,omitempty"` + // When applicable, this property value will be the field that generated the error. + Field *string `json:"field,omitempty"` + // When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error. + Help *map[string]interface{} `json:"help,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_all_response.go b/rest/api/v3/webhooks/model_event_webhook_all_response.go new file mode 100644 index 00000000..88a98136 --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_all_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventWebhookAllResponse struct for EventWebhookAllResponse +type EventWebhookAllResponse struct { + // The maximum number of Event Webhooks you can have enabled under your current Twilio SendGrid plan. See the [Twilio SendGrid pricing page](https://sendgrid.com/pricing) for more information about the features available with each plan. + MaxAllowed *float32 `json:"max_allowed,omitempty"` + // An array of Event Webhook objects. Each object represents one of your webhooks and contains its configuration settings, including which events it is set to send in the POST request, the URL where it will send those events, and the webhook's ID. + Webhooks *[]EventWebhookSignedResponse `json:"webhooks,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_base_response_props.go b/rest/api/v3/webhooks/model_event_webhook_base_response_props.go new file mode 100644 index 00000000..54cc937e --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_base_response_props.go @@ -0,0 +1,50 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventWebhookBaseResponseProps struct for EventWebhookBaseResponseProps +type EventWebhookBaseResponseProps struct { + // Indicates if the Event Webhook is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The URL where SendGrid will send event data. + Url *string `json:"url,omitempty"` + // Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. + AccountStatusChange *bool `json:"account_status_change,omitempty"` + // Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupResubscribe *bool `json:"group_resubscribe,omitempty"` + // Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. + Delivered *bool `json:"delivered,omitempty"` + // Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupUnsubscribe *bool `json:"group_unsubscribe,omitempty"` + // Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. + SpamReport *bool `json:"spam_report,omitempty"` + // Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. + Bounce *bool `json:"bounce,omitempty"` + // Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. + Deferred *bool `json:"deferred,omitempty"` + // Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + Unsubscribe *bool `json:"unsubscribe,omitempty"` + // Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. + Processed *bool `json:"processed,omitempty"` + // Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. + Open *bool `json:"open,omitempty"` + // Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. + Click *bool `json:"click,omitempty"` + // Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. + Dropped *bool `json:"dropped,omitempty"` + // An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. + FriendlyName *string `json:"friendly_name,omitempty"` + // A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. + Id *string `json:"id,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_date_response_props.go b/rest/api/v3/webhooks/model_event_webhook_date_response_props.go new file mode 100644 index 00000000..b848c4ae --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_date_response_props.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// EventWebhookDateResponseProps struct for EventWebhookDateResponseProps +type EventWebhookDateResponseProps struct { + // An ISO 8601 timestamp in UTC timezone when the Event Webhook was created. If a Webhook's `created_date` is `null`, it is a [legacy Event Webook](https://www.twilio.com/en-us/changelog/event-webhooks), which means it is your oldest Webhook. + CreatedDate *time.Time `json:"created_date,omitempty"` + // An ISO 8601 timestamp in UTC timezone when the Event Webhook was last modified. + UpdatedDate *time.Time `json:"updated_date,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_no_dates_response.go b/rest/api/v3/webhooks/model_event_webhook_no_dates_response.go new file mode 100644 index 00000000..1b91692a --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_no_dates_response.go @@ -0,0 +1,56 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventWebhookNoDatesResponse struct for EventWebhookNoDatesResponse +type EventWebhookNoDatesResponse struct { + // Indicates if the Event Webhook is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The URL where SendGrid will send event data. + Url *string `json:"url,omitempty"` + // Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. + AccountStatusChange *bool `json:"account_status_change,omitempty"` + // Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupResubscribe *bool `json:"group_resubscribe,omitempty"` + // Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. + Delivered *bool `json:"delivered,omitempty"` + // Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupUnsubscribe *bool `json:"group_unsubscribe,omitempty"` + // Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. + SpamReport *bool `json:"spam_report,omitempty"` + // Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. + Bounce *bool `json:"bounce,omitempty"` + // Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. + Deferred *bool `json:"deferred,omitempty"` + // Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + Unsubscribe *bool `json:"unsubscribe,omitempty"` + // Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. + Processed *bool `json:"processed,omitempty"` + // Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. + Open *bool `json:"open,omitempty"` + // Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. + Click *bool `json:"click,omitempty"` + // Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. + Dropped *bool `json:"dropped,omitempty"` + // An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. + FriendlyName *string `json:"friendly_name,omitempty"` + // A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. + Id *string `json:"id,omitempty"` + // The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. + OauthClientId *string `json:"oauth_client_id,omitempty"` + // The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. + OauthTokenUrl *string `json:"oauth_token_url,omitempty"` + // The public key you can use to verify the SendGrid signature. + PublicKey *string `json:"public_key,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_oauth_response_props.go b/rest/api/v3/webhooks/model_event_webhook_oauth_response_props.go new file mode 100644 index 00000000..b57aa7d3 --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_oauth_response_props.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventWebhookOauthResponseProps struct for EventWebhookOauthResponseProps +type EventWebhookOauthResponseProps struct { + // The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. + OauthClientId *string `json:"oauth_client_id,omitempty"` + // The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. + OauthTokenUrl *string `json:"oauth_token_url,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_request.go b/rest/api/v3/webhooks/model_event_webhook_request.go new file mode 100644 index 00000000..352f8866 --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_request.go @@ -0,0 +1,52 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventWebhookRequest struct for EventWebhookRequest +type EventWebhookRequest struct { + // Set this property to `true` to enable the Event Webhook or `false` to disable it. + Enabled *bool `json:"enabled,omitempty"` + // Set this property to the URL where you want the Event Webhook to send event data. + Url string `json:"url"` + // Set this property to `true` to receive group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupResubscribe *bool `json:"group_resubscribe,omitempty"` + // Set this property to `true` to receive delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. + Delivered *bool `json:"delivered,omitempty"` + // Set this property to `true` to receive group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupUnsubscribe *bool `json:"group_unsubscribe,omitempty"` + // Set this property to `true` to receive spam report events. Spam reports occur when recipients mark a message as spam. + SpamReport *bool `json:"spam_report,omitempty"` + // Set this property to `true` to receive bounce events. A bounce occurs when a receiving server could not or would not accept a message. + Bounce *bool `json:"bounce,omitempty"` + // Set this property to `true` to receive deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. + Deferred *bool `json:"deferred,omitempty"` + // Set this property to `true` to receive unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + Unsubscribe *bool `json:"unsubscribe,omitempty"` + // Set this property to `true` to receive processed events. Processed events occur when a message has been received by Twilio SendGrid and the message is ready to be delivered. + Processed *bool `json:"processed,omitempty"` + // Set this property to `true` to receive open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. + Open *bool `json:"open,omitempty"` + // Set this property to `true` to receive click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. + Click *bool `json:"click,omitempty"` + // Set this property to `true` to receive dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. + Dropped *bool `json:"dropped,omitempty"` + // Optionally set this property to a friendly name for the Event Webhook. A friendly name may be assigned to each of your webhooks to help you differentiate them. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. + FriendlyName *string `json:"friendly_name,omitempty"` + // Set this property to the OAuth client ID that SendGrid will pass to your OAuth server or service provider to generate an OAuth access token. When passing data in this property, you must also include the `oauth_token_url` property. + OauthClientId *string `json:"oauth_client_id,omitempty"` + // Set this property to the OAuth client secret that SendGrid will pass to your OAuth server or service provider to generate an OAuth access token. This secret is needed only once to create an access token. SendGrid will store the secret, allowing you to update your client ID and Token URL without passing the secret to SendGrid again. When passing data in this field, you must also include the `oauth_client_id` and `oauth_token_url` properties. + OauthClientSecret *string `json:"oauth_client_secret,omitempty"` + // Set this property to the URL where SendGrid will send the OAuth client ID and client secret to generate an OAuth access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the `oauth_client_id` property. + OauthTokenUrl *string `json:"oauth_token_url,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_signed_response.go b/rest/api/v3/webhooks/model_event_webhook_signed_response.go new file mode 100644 index 00000000..b867cfff --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_signed_response.go @@ -0,0 +1,64 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// EventWebhookSignedResponse struct for EventWebhookSignedResponse +type EventWebhookSignedResponse struct { + // Indicates if the Event Webhook is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The URL where SendGrid will send event data. + Url *string `json:"url,omitempty"` + // Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. + AccountStatusChange *bool `json:"account_status_change,omitempty"` + // Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupResubscribe *bool `json:"group_resubscribe,omitempty"` + // Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. + Delivered *bool `json:"delivered,omitempty"` + // Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupUnsubscribe *bool `json:"group_unsubscribe,omitempty"` + // Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. + SpamReport *bool `json:"spam_report,omitempty"` + // Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. + Bounce *bool `json:"bounce,omitempty"` + // Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. + Deferred *bool `json:"deferred,omitempty"` + // Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + Unsubscribe *bool `json:"unsubscribe,omitempty"` + // Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. + Processed *bool `json:"processed,omitempty"` + // Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. + Open *bool `json:"open,omitempty"` + // Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. + Click *bool `json:"click,omitempty"` + // Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. + Dropped *bool `json:"dropped,omitempty"` + // An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. + FriendlyName *string `json:"friendly_name,omitempty"` + // A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. + Id *string `json:"id,omitempty"` + // An ISO 8601 timestamp in UTC timezone when the Event Webhook was created. If a Webhook's `created_date` is `null`, it is a [legacy Event Webook](https://www.twilio.com/en-us/changelog/event-webhooks), which means it is your oldest Webhook. + CreatedDate *time.Time `json:"created_date,omitempty"` + // An ISO 8601 timestamp in UTC timezone when the Event Webhook was last modified. + UpdatedDate *time.Time `json:"updated_date,omitempty"` + // The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. + OauthClientId *string `json:"oauth_client_id,omitempty"` + // The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. + OauthTokenUrl *string `json:"oauth_token_url,omitempty"` + // The public key you can use to verify the SendGrid signature. + PublicKey *string `json:"public_key,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_signed_response_prop.go b/rest/api/v3/webhooks/model_event_webhook_signed_response_prop.go new file mode 100644 index 00000000..6751471b --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_signed_response_prop.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventWebhookSignedResponseProp struct for EventWebhookSignedResponseProp +type EventWebhookSignedResponseProp struct { + // The public key you can use to verify the SendGrid signature. + PublicKey *string `json:"public_key,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_test_request.go b/rest/api/v3/webhooks/model_event_webhook_test_request.go new file mode 100644 index 00000000..402bed8c --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_test_request.go @@ -0,0 +1,28 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// EventWebhookTestRequest struct for EventWebhookTestRequest +type EventWebhookTestRequest struct { + // The ID of the Event Webhook you want to retrieve. + Id *string `json:"id,omitempty"` + // The URL where you would like the test notification to be sent. + Url string `json:"url"` + // The client ID Twilio SendGrid sends to your OAuth server or service provider to generate an OAuth access token. When passing data in this property, you must also include the `oauth_token_url` property. + OauthClientId *string `json:"oauth_client_id,omitempty"` + // The `oauth_client_secret` is needed only once to create an access token. SendGrid will store this secret, allowing you to update your Client ID and Token URL without passing the secret to SendGrid again. When passing data in this field, you must also include the `oauth_client_id` and `oauth_token_url` properties. + OauthClientSecret *string `json:"oauth_client_secret,omitempty"` + // The URL where Twilio SendGrid sends the Client ID and Client Secret to generate an access token. This should be your OAuth server or service provider. When passing data in this field, you must also include the `oauth_client_id` property. + OauthTokenUrl *string `json:"oauth_token_url,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_event_webhook_unsigned_response.go b/rest/api/v3/webhooks/model_event_webhook_unsigned_response.go new file mode 100644 index 00000000..9739fa46 --- /dev/null +++ b/rest/api/v3/webhooks/model_event_webhook_unsigned_response.go @@ -0,0 +1,62 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +import ( + "time" +) + +// EventWebhookUnsignedResponse struct for EventWebhookUnsignedResponse +type EventWebhookUnsignedResponse struct { + // Indicates if the Event Webhook is enabled. + Enabled *bool `json:"enabled,omitempty"` + // The URL where SendGrid will send event data. + Url *string `json:"url,omitempty"` + // Indicates if the webhook is configured to send account status change events related to compliance action taken by SendGrid. + AccountStatusChange *bool `json:"account_status_change,omitempty"` + // Indicates if the webhook is configured to send group resubscribe events. Group resubscribes occur when recipients resubscribe to a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupResubscribe *bool `json:"group_resubscribe,omitempty"` + // Indicates if the webhook is configured to send delivered events. Delivered events occur when a message has been successfully delivered to the receiving server. + Delivered *bool `json:"delivered,omitempty"` + // Indicates if the webhook is configured to send group unsubscribe events. Group unsubscribes occur when recipients unsubscribe from a specific [unsubscribe group](https://docs.sendgrid.com/ui/sending-email/create-and-manage-unsubscribe-groups) either by direct link or by updating their subscription preferences. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + GroupUnsubscribe *bool `json:"group_unsubscribe,omitempty"` + // Indicates if the webhook is configured to send spam report events. Spam reports occur when recipients mark a message as spam. + SpamReport *bool `json:"spam_report,omitempty"` + // Indicates if the webhook is configured to send bounce events. A bounce occurs when a receiving server could not or would not accept a message. + Bounce *bool `json:"bounce,omitempty"` + // Indicates if the webhook is configured to send deferred events. Deferred events occur when a recipient's email server temporarily rejects a message. + Deferred *bool `json:"deferred,omitempty"` + // Indicates if the webhook is configured to send unsubscribe events. Unsubscribes occur when recipients click on a message's subscription management link. You must [enable Subscription Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#subscription-tracking) to receive this type of event. + Unsubscribe *bool `json:"unsubscribe,omitempty"` + // Indicates if the webhook is configured to send processed events. Processed events occur when a message has been received by Twilio SendGrid and is ready to be delivered. + Processed *bool `json:"processed,omitempty"` + // Indicates if the webhook is configured to send open events. Open events occur when a recipient has opened the HTML message. You must [enable Open Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#open-tracking) to receive this type of event. + Open *bool `json:"open,omitempty"` + // Indicates if the webhook is configured to send click events. Click events occur when a recipient clicks on a link within the message. You must [enable Click Tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking#click-tracking) to receive this type of event. + Click *bool `json:"click,omitempty"` + // Indicates if the webhook is configured to send dropped events. Dropped events occur when your message is not delivered by Twilio SendGrid. Dropped events are accomponied by a `reason` property, which indicates why the message was dropped. Reasons for a dropped message include: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota. + Dropped *bool `json:"dropped,omitempty"` + // An optional friendly name assigned to the Event Webhook to help you differentiate it. The friendly name is for convenience only. You should use the webhook `id` property for any programmatic tasks. + FriendlyName *string `json:"friendly_name,omitempty"` + // A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. + Id *string `json:"id,omitempty"` + // An ISO 8601 timestamp in UTC timezone when the Event Webhook was created. If a Webhook's `created_date` is `null`, it is a [legacy Event Webook](https://www.twilio.com/en-us/changelog/event-webhooks), which means it is your oldest Webhook. + CreatedDate *time.Time `json:"created_date,omitempty"` + // An ISO 8601 timestamp in UTC timezone when the Event Webhook was last modified. + UpdatedDate *time.Time `json:"updated_date,omitempty"` + // The OAuth client ID SendGrid sends to your OAuth server or service provider to generate an OAuth access token. + OauthClientId *string `json:"oauth_client_id,omitempty"` + // The URL where SendGrid sends the OAuth client ID and client secret to generate an access token. This should be your OAuth server or service provider. + OauthTokenUrl *string `json:"oauth_token_url,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_get_signed_event_webhook_200_response.go b/rest/api/v3/webhooks/model_get_signed_event_webhook_200_response.go new file mode 100644 index 00000000..0282f0ed --- /dev/null +++ b/rest/api/v3/webhooks/model_get_signed_event_webhook_200_response.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetSignedEventWebhook200Response struct for GetSignedEventWebhook200Response +type GetSignedEventWebhook200Response struct { + // A unique string used to identify the webhook. A webhook's ID is generated programmatically and cannot be changed after creation. You can assign a natural language identifier to your webhook using the `friendly_name` property. + Id *string `json:"id,omitempty"` + // The public key you can use to verify the Twilio SendGrid signature. + PublicKey *string `json:"public_key,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_get_signed_event_webhook_404_response.go b/rest/api/v3/webhooks/model_get_signed_event_webhook_404_response.go new file mode 100644 index 00000000..162dcb9b --- /dev/null +++ b/rest/api/v3/webhooks/model_get_signed_event_webhook_404_response.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetSignedEventWebhook404Response struct for GetSignedEventWebhook404Response +type GetSignedEventWebhook404Response struct { + Errors *[]GetSignedEventWebhook404ResponseErrorsInner `json:"errors,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_get_signed_event_webhook_404_response_errors_inner.go b/rest/api/v3/webhooks/model_get_signed_event_webhook_404_response_errors_inner.go new file mode 100644 index 00000000..9c83f2aa --- /dev/null +++ b/rest/api/v3/webhooks/model_get_signed_event_webhook_404_response_errors_inner.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// GetSignedEventWebhook404ResponseErrorsInner struct for GetSignedEventWebhook404ResponseErrorsInner +type GetSignedEventWebhook404ResponseErrorsInner struct { + // Error message. + Message *string `json:"message,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_list_parse_setting_200_response.go b/rest/api/v3/webhooks/model_list_parse_setting_200_response.go new file mode 100644 index 00000000..29e79746 --- /dev/null +++ b/rest/api/v3/webhooks/model_list_parse_setting_200_response.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListParseSetting200Response struct for ListParseSetting200Response +type ListParseSetting200Response struct { + // The list of your current inbound parse settings. + Result *[]ParseSetting `json:"result,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_list_parse_static_200_response_inner.go b/rest/api/v3/webhooks/model_list_parse_static_200_response_inner.go new file mode 100644 index 00000000..2ed8fae6 --- /dev/null +++ b/rest/api/v3/webhooks/model_list_parse_static_200_response_inner.go @@ -0,0 +1,22 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListParseStatic200ResponseInner struct for ListParseStatic200ResponseInner +type ListParseStatic200ResponseInner struct { + // The date that the stats were collected. + Date string `json:"date"` + // The Parse Webhook usage statistics. + Stats []ListParseStatic200ResponseInnerStatsInner `json:"stats"` +} diff --git a/rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner.go b/rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner.go new file mode 100644 index 00000000..5a2cc1ad --- /dev/null +++ b/rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner.go @@ -0,0 +1,19 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListParseStatic200ResponseInnerStatsInner struct for ListParseStatic200ResponseInnerStatsInner +type ListParseStatic200ResponseInnerStatsInner struct { + Metrics *ListParseStatic200ResponseInnerStatsInnerMetrics `json:"metrics,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner_metrics.go b/rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner_metrics.go new file mode 100644 index 00000000..929a73b4 --- /dev/null +++ b/rest/api/v3/webhooks/model_list_parse_static_200_response_inner_stats_inner_metrics.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ListParseStatic200ResponseInnerStatsInnerMetrics struct for ListParseStatic200ResponseInnerStatsInnerMetrics +type ListParseStatic200ResponseInnerStatsInnerMetrics struct { + // The number of emails received and parsed by the Parse Webhook. + Received float32 `json:"received"` +} diff --git a/rest/api/v3/webhooks/model_parse_setting.go b/rest/api/v3/webhooks/model_parse_setting.go new file mode 100644 index 00000000..44d9eddf --- /dev/null +++ b/rest/api/v3/webhooks/model_parse_setting.go @@ -0,0 +1,26 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// ParseSetting struct for ParseSetting +type ParseSetting struct { + // The public URL where you would like SendGrid to POST the data parsed from your email. Any emails sent with the given hostname provided (whose MX records have been updated to point to SendGrid) will be parsed and POSTed to this URL. + Url *string `json:"url,omitempty"` + // A specific and unique domain or subdomain that you have created to use exclusively to parse your incoming email. For example, `parse.yourdomain.com`. + Hostname *string `json:"hostname,omitempty"` + // Indicates if you would like SendGrid to check the content parsed from your emails for spam before POSTing them to your domain. + SpamCheck *bool `json:"spam_check,omitempty"` + // Indicates if you would like SendGrid to post the original MIME-type content of your parsed email. When this parameter is set to `true`, SendGrid will send a JSON payload of the content of your email. + SendRaw *bool `json:"send_raw,omitempty"` +} diff --git a/rest/api/v3/webhooks/model_update_signed_event_webhook_request.go b/rest/api/v3/webhooks/model_update_signed_event_webhook_request.go new file mode 100644 index 00000000..c3d5ecaa --- /dev/null +++ b/rest/api/v3/webhooks/model_update_signed_event_webhook_request.go @@ -0,0 +1,20 @@ +/* +* This code was generated by +* +* SENDGRID-OAI-GENERATOR +* +* Twilio SendGrid Webhook Configuration API +* The Twilio SendGrid Webhooks API allows you to configure the Event and Parse Webhooks. Email is a data-rich channel, and implementing the Event Webhook will allow you to consume those data in nearly real time. This means you can actively monitor and participate in the health of your email program throughout the send cycle. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments and then POSTs `multipart/form-data` to a URL that you choose. +* +* NOTE: This class is auto generated by OpenAPI Generator. +* https://openapi-generator.tech +* Do not edit the class manually. + */ + +package openapi + +// UpdateSignedEventWebhookRequest struct for UpdateSignedEventWebhookRequest +type UpdateSignedEventWebhookRequest struct { + // Enable or disable the webhook by setting this property to `true` or `false`, respectively. + Enabled bool `json:"enabled"` +} diff --git a/sendgrid.go b/sendgrid.go index f9986f6e..5dd16ea0 100644 --- a/sendgrid.go +++ b/sendgrid.go @@ -36,8 +36,8 @@ import ( LmcSendersV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/lmc_senders" MailV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mail" MailSettingsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mail_settings" - McContactsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mc_contacts" McCustomFieldsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mc_custom_fields" + McDesignsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mc_designs" McListsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mc_lists" McSegmentsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mc_segments" McSegments2V3 "github.com/sendgrid/sendgrid-go/rest/api/v3/mc_segments_2" @@ -51,8 +51,9 @@ import ( ScheduledSendsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/scheduled_sends" ScopesV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/scopes" SeqV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/seq" + SsoV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/sso" + StatsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/stats" SubusersV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/subusers" - SuppressionsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/suppressions" TeammatesV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/teammates" TemplatesV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/templates" TrackingSettingsV3 "github.com/sendgrid/sendgrid-go/rest/api/v3/tracking_settings" @@ -82,8 +83,8 @@ type RestClient struct { LmcSendersV3 *LmcSendersV3.ApiService MailV3 *MailV3.ApiService MailSettingsV3 *MailSettingsV3.ApiService - McContactsV3 *McContactsV3.ApiService McCustomFieldsV3 *McCustomFieldsV3.ApiService + McDesignsV3 *McDesignsV3.ApiService McListsV3 *McListsV3.ApiService McSegmentsV3 *McSegmentsV3.ApiService McSegments2V3 *McSegments2V3.ApiService @@ -97,8 +98,9 @@ type RestClient struct { ScheduledSendsV3 *ScheduledSendsV3.ApiService ScopesV3 *ScopesV3.ApiService SeqV3 *SeqV3.ApiService + SsoV3 *SsoV3.ApiService + StatsV3 *StatsV3.ApiService SubusersV3 *SubusersV3.ApiService - SuppressionsV3 *SuppressionsV3.ApiService TeammatesV3 *TeammatesV3.ApiService TemplatesV3 *TemplatesV3.ApiService TrackingSettingsV3 *TrackingSettingsV3.ApiService @@ -212,8 +214,8 @@ func NewRestClientWithParams(params ClientParams) *RestClient { c.LmcSendersV3 = LmcSendersV3.NewApiService(c.RequestHandler) c.MailV3 = MailV3.NewApiService(c.RequestHandler) c.MailSettingsV3 = MailSettingsV3.NewApiService(c.RequestHandler) - c.McContactsV3 = McContactsV3.NewApiService(c.RequestHandler) c.McCustomFieldsV3 = McCustomFieldsV3.NewApiService(c.RequestHandler) + c.McDesignsV3 = McDesignsV3.NewApiService(c.RequestHandler) c.McListsV3 = McListsV3.NewApiService(c.RequestHandler) c.McSegmentsV3 = McSegmentsV3.NewApiService(c.RequestHandler) c.McSegments2V3 = McSegments2V3.NewApiService(c.RequestHandler) @@ -227,8 +229,9 @@ func NewRestClientWithParams(params ClientParams) *RestClient { c.ScheduledSendsV3 = ScheduledSendsV3.NewApiService(c.RequestHandler) c.ScopesV3 = ScopesV3.NewApiService(c.RequestHandler) c.SeqV3 = SeqV3.NewApiService(c.RequestHandler) + c.SsoV3 = SsoV3.NewApiService(c.RequestHandler) + c.StatsV3 = StatsV3.NewApiService(c.RequestHandler) c.SubusersV3 = SubusersV3.NewApiService(c.RequestHandler) - c.SuppressionsV3 = SuppressionsV3.NewApiService(c.RequestHandler) c.TeammatesV3 = TeammatesV3.NewApiService(c.RequestHandler) c.TemplatesV3 = TemplatesV3.NewApiService(c.RequestHandler) c.TrackingSettingsV3 = TrackingSettingsV3.NewApiService(c.RequestHandler)