ofac: github.com/moov-io/ofac/client Index | Files

package openapi

import "github.com/moov-io/ofac/client"

Index

Package Files

api_ofac.go client.go configuration.go model_address.go model_alt.go model_download.go model_ofac_company.go model_ofac_company_status.go model_ofac_customer.go model_ofac_customer_status.go model_sdn.go model_search.go model_update_company_status.go model_update_customer_status.go model_watch.go model_watch_request.go response.go

Variables

var (
    // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
    ContextOAuth2 = contextKey("token")

    // ContextBasicAuth takes BasicAuth as authentication for the request.
    ContextBasicAuth = contextKey("basic")

    // ContextAccessToken takes a string oauth2 access token as authentication for the request.
    ContextAccessToken = contextKey("accesstoken")

    // ContextAPIKey takes an APIKey as authentication for the request
    ContextAPIKey = contextKey("apikey")
)

func CacheExpires Uses

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

type APIClient Uses

type APIClient struct {
    OFACApi *OFACApiService
    // contains filtered or unexported fields
}

APIClient manages communication with the OFAC API API vv1 In most cases there should be only one, shared, APIClient.

func NewAPIClient Uses

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath Uses

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey Uses

type APIKey struct {
    Key    string
    Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse Uses

type APIResponse struct {
    *http.Response `json:"-"`
    Message        string `json:"message,omitempty"`
    // Operation is the name of the OpenAPI operation.
    Operation string `json:"operation,omitempty"`
    // RequestURL is the request URL. This value is always available, even if the
    // embedded *http.Response is nil.
    RequestURL string `json:"url,omitempty"`
    // Method is the HTTP method used for the request.  This value is always
    // available, even if the embedded *http.Response is nil.
    Method string `json:"method,omitempty"`
    // Payload holds the contents of the response body (which may be nil or empty).
    // This is provided here as the raw response.Body() reader will have already
    // been drained.
    Payload []byte `json:"-"`
}

func NewAPIResponse Uses

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError Uses

func NewAPIResponseWithError(errorMessage string) *APIResponse

type AddCompanyNameWatchOpts Uses

type AddCompanyNameWatchOpts struct {
    XRequestId optional.String
}

type AddCompanyWatchOpts Uses

type AddCompanyWatchOpts struct {
    XRequestId optional.String
}

type AddCustomerNameWatchOpts Uses

type AddCustomerNameWatchOpts struct {
    XRequestId optional.String
}

type AddCustomerWatchOpts Uses

type AddCustomerWatchOpts struct {
    XRequestId optional.String
}

type Address Uses

type Address struct {
    EntityID                    string  `json:"entityID,omitempty"`
    AddressID                   string  `json:"addressID,omitempty"`
    Address                     string  `json:"address,omitempty"`
    CityStateProvincePostalCode string  `json:"cityStateProvincePostalCode,omitempty"`
    Country                     string  `json:"country,omitempty"`
    Match                       float32 `json:"match,omitempty"`
}

Physical address from OFAC list

type Alt Uses

type Alt struct {
    EntityID         string  `json:"entityID,omitempty"`
    AlternateID      string  `json:"alternateID,omitempty"`
    AlternateType    string  `json:"alternateType,omitempty"`
    AlternateName    string  `json:"alternateName,omitempty"`
    AlternateRemarks string  `json:"alternateRemarks,omitempty"`
    Match            float32 `json:"match,omitempty"`
}

Alternate name from OFAC list

type BasicAuth Uses

type BasicAuth struct {
    UserName string `json:"userName,omitempty"`
    Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration Uses

type Configuration struct {
    BasePath      string            `json:"basePath,omitempty"`
    Host          string            `json:"host,omitempty"`
    Scheme        string            `json:"scheme,omitempty"`
    DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
    UserAgent     string            `json:"userAgent,omitempty"`
    HTTPClient    *http.Client
}

func NewConfiguration Uses

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader Uses

func (c *Configuration) AddDefaultHeader(key string, value string)

type Download Uses

type Download struct {
    SDNs      int32     `json:"SDNs,omitempty"`
    AltNames  int32     `json:"altNames,omitempty"`
    Addresses int32     `json:"addresses,omitempty"`
    Timestamp time.Time `json:"timestamp,omitempty"`
}

Metadata and stats about downloaded OFAC data

type GenericOpenAPIError Uses

type GenericOpenAPIError struct {
    // contains filtered or unexported fields
}

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body Uses

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error Uses

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model Uses

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type GetCompanyOpts Uses

type GetCompanyOpts struct {
    XRequestId optional.String
}

type GetCustomerOpts Uses

type GetCustomerOpts struct {
    XRequestId optional.String
}

type GetLatestDownloadsOpts Uses

type GetLatestDownloadsOpts struct {
    Limit optional.Int32
}

type GetSDNAddressesOpts Uses

type GetSDNAddressesOpts struct {
    XRequestId optional.String
}

type GetSDNAltNamesOpts Uses

type GetSDNAltNamesOpts struct {
    XRequestId optional.String
}

type GetSDNOpts Uses

type GetSDNOpts struct {
    XRequestId optional.String
}

type OFACApiService Uses

type OFACApiService service

func (*OFACApiService) AddCompanyNameWatch Uses

func (a *OFACApiService) AddCompanyNameWatch(ctx context.Context, name string, watchRequest WatchRequest, localVarOptionals *AddCompanyNameWatchOpts) (Watch, *http.Response, error)

func (*OFACApiService) AddCompanyWatch Uses

func (a *OFACApiService) AddCompanyWatch(ctx context.Context, companyId string, watchRequest WatchRequest, localVarOptionals *AddCompanyWatchOpts) (Watch, *http.Response, error)

func (*OFACApiService) AddCustomerNameWatch Uses

func (a *OFACApiService) AddCustomerNameWatch(ctx context.Context, name string, watchRequest WatchRequest, localVarOptionals *AddCustomerNameWatchOpts) (Watch, *http.Response, error)

func (*OFACApiService) AddCustomerWatch Uses

func (a *OFACApiService) AddCustomerWatch(ctx context.Context, customerId string, watchRequest WatchRequest, localVarOptionals *AddCustomerWatchOpts) (Watch, *http.Response, error)

func (*OFACApiService) GetCompany Uses

func (a *OFACApiService) GetCompany(ctx context.Context, companyId string, localVarOptionals *GetCompanyOpts) (OfacCompany, *http.Response, error)

func (*OFACApiService) GetCustomer Uses

func (a *OFACApiService) GetCustomer(ctx context.Context, customerId string, localVarOptionals *GetCustomerOpts) (OfacCustomer, *http.Response, error)

func (*OFACApiService) GetLatestDownloads Uses

func (a *OFACApiService) GetLatestDownloads(ctx context.Context, localVarOptionals *GetLatestDownloadsOpts) ([]Download, *http.Response, error)

func (*OFACApiService) GetSDN Uses

func (a *OFACApiService) GetSDN(ctx context.Context, sdnId string, localVarOptionals *GetSDNOpts) (Sdn, *http.Response, error)

func (*OFACApiService) GetSDNAddresses Uses

func (a *OFACApiService) GetSDNAddresses(ctx context.Context, sdnId string, localVarOptionals *GetSDNAddressesOpts) ([]Address, *http.Response, error)

func (*OFACApiService) GetSDNAltNames Uses

func (a *OFACApiService) GetSDNAltNames(ctx context.Context, sdnId string, localVarOptionals *GetSDNAltNamesOpts) ([]Alt, *http.Response, error)

func (*OFACApiService) Ping Uses

func (a *OFACApiService) Ping(ctx context.Context) (*http.Response, error)

OFACApiService Ping the OFAC service to check if running

* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

func (*OFACApiService) RemoveCompanyNameWatch Uses

func (a *OFACApiService) RemoveCompanyNameWatch(ctx context.Context, watchId string, name string, localVarOptionals *RemoveCompanyNameWatchOpts) (*http.Response, error)

func (*OFACApiService) RemoveCompanyWatch Uses

func (a *OFACApiService) RemoveCompanyWatch(ctx context.Context, companyId string, watchId string, localVarOptionals *RemoveCompanyWatchOpts) (*http.Response, error)

func (*OFACApiService) RemoveCustomerNameWatch Uses

func (a *OFACApiService) RemoveCustomerNameWatch(ctx context.Context, watchId string, name string, localVarOptionals *RemoveCustomerNameWatchOpts) (*http.Response, error)

func (*OFACApiService) RemoveCustomerWatch Uses

func (a *OFACApiService) RemoveCustomerWatch(ctx context.Context, customerId string, watchId string, localVarOptionals *RemoveCustomerWatchOpts) (*http.Response, error)

func (*OFACApiService) SearchSDNs Uses

func (a *OFACApiService) SearchSDNs(ctx context.Context, localVarOptionals *SearchSDNsOpts) (Search, *http.Response, error)

func (*OFACApiService) UpdateCompanyStatus Uses

func (a *OFACApiService) UpdateCompanyStatus(ctx context.Context, companyId string, updateCompanyStatus UpdateCompanyStatus, localVarOptionals *UpdateCompanyStatusOpts) (*http.Response, error)

func (*OFACApiService) UpdateCustomerStatus Uses

func (a *OFACApiService) UpdateCustomerStatus(ctx context.Context, customerId string, updateCustomerStatus UpdateCustomerStatus, localVarOptionals *UpdateCustomerStatusOpts) (*http.Response, error)

type OfacCompany Uses

type OfacCompany struct {
    // OFAC Company ID
    Id        string            `json:"id,omitempty"`
    Sdn       Sdn               `json:"sdn,omitempty"`
    Addresses []Address         `json:"addresses,omitempty"`
    Alts      []Alt             `json:"alts,omitempty"`
    Status    OfacCompanyStatus `json:"status,omitempty"`
}

OFAC Company and metadata

type OfacCompanyStatus Uses

type OfacCompanyStatus struct {
    // User ID provided when updating status
    UserId string `json:"userId,omitempty"`
    // Optional note from updating status
    Note string `json:"note,omitempty"`
    // Manually applied status for OFAC Company
    Status    string    `json:"status,omitempty"`
    CreatedAt time.Time `json:"createdAt,omitempty"`
}

Status properties of an OFAC Company

type OfacCustomer Uses

type OfacCustomer struct {
    // OFAC Customer ID
    Id        string             `json:"id,omitempty"`
    Sdn       Sdn                `json:"sdn,omitempty"`
    Addresses []Address          `json:"addresses,omitempty"`
    Alts      []Alt              `json:"alts,omitempty"`
    Status    OfacCustomerStatus `json:"status,omitempty"`
}

OFAC Customer and metadata

type OfacCustomerStatus Uses

type OfacCustomerStatus struct {
    // User ID provided when updating status
    UserId string `json:"userId,omitempty"`
    // Optional note from updating status
    Note string `json:"note,omitempty"`
    // Manually applied status for OFAC Customer
    Status    string    `json:"status,omitempty"`
    CreatedAt time.Time `json:"createdAt,omitempty"`
}

Status properties of an OFAC Customer

type RemoveCompanyNameWatchOpts Uses

type RemoveCompanyNameWatchOpts struct {
    XRequestId optional.String
}

type RemoveCompanyWatchOpts Uses

type RemoveCompanyWatchOpts struct {
    XRequestId optional.String
}

type RemoveCustomerNameWatchOpts Uses

type RemoveCustomerNameWatchOpts struct {
    XRequestId optional.String
}

type RemoveCustomerWatchOpts Uses

type RemoveCustomerWatchOpts struct {
    XRequestId optional.String
}

type Sdn Uses

type Sdn struct {
    EntityID string `json:"entityID,omitempty"`
    SdnName  string `json:"sdnName,omitempty"`
    // SDN's typically represent an individual (customer) or trust/company/organization. OFAC endpoints refer to customers or companies as different entities, but underlying both is the same SDN metadata.
    SdnType string `json:"sdnType,omitempty"`
    Program string `json:"program,omitempty"`
    Title   string `json:"title,omitempty"`
    Remarks string `json:"remarks,omitempty"`
    // Remarks on SDN and often additional information about the SDN
    Match float32 `json:"match,omitempty"`
}

Specially designated national from OFAC list

type Search struct {
    SDNs      []Sdn     `json:"SDNs,omitempty"`
    AltNames  []Alt     `json:"altNames,omitempty"`
    Addresses []Address `json:"addresses,omitempty"`
}

Search results containing SDNs, alternate names and/or addreses

type SearchSDNsOpts Uses

type SearchSDNsOpts struct {
    XRequestId optional.String
    Q          optional.String
    Name       optional.String
    Address    optional.String
    AltName    optional.String
    Limit      optional.Int32
}

type UpdateCompanyStatus Uses

type UpdateCompanyStatus struct {
    // manual override of company/SDN sanction status
    Status string `json:"status"`
}

Request body to update a company status.

type UpdateCompanyStatusOpts Uses

type UpdateCompanyStatusOpts struct {
    XRequestId optional.String
}

type UpdateCustomerStatus Uses

type UpdateCustomerStatus struct {
    // manual override of customer/SDN sanction status
    Status string `json:"status"`
}

Request body to update a customers status.

type UpdateCustomerStatusOpts Uses

type UpdateCustomerStatusOpts struct {
    XRequestId optional.String
}

type Watch Uses

type Watch struct {
    // Object representing a customer or company watch
    WatchId string `json:"watchId,omitempty"`
}

Customer or Company watch

type WatchRequest Uses

type WatchRequest struct {
    // Private token supplied by clients to be used for authenticating webhooks.
    AuthToken string `json:"authToken"`
    // HTTPS url for webhook on search match
    Webhook string `json:"webhook"`
}

Webhook or other means of notification on search criteria. OFAC will make a POST request with a body of the customer (SDN, AltNames, and Address).

Package openapi imports 21 packages (graph) and is imported by 1 packages. Updated 2019-03-19. Refresh now. Tools for package owners.