swagger

package module
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

README

Go API client for Meltwater

Disclaimer: This client was generated automatically based on our Swagger Spec. We are sharing it for purely demonstrative purposes. We hope it it helps. If you have any comments please open an issue, we would love to hear from you!

The Meltwater Streaming API provides the needed resources for Meltwater clients to create & delete REST Hooks and stream Meltwater search results to your specified destination.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 2.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

    "./swagger"

Documentation for API Endpoints

All URIs are relative to https://api.meltwater.com

Class Method HTTP request Description
ClientsApi CreateClientCredentials Post /v2/clients Register new client
ClientsApi DeleteClientCredentials Delete /v2/clients/{client_id} Delete client.
HooksApi CreateHook Post /v2/hooks Creates a hook for one of your predefined searches.
HooksApi DeleteHook Delete /v2/hooks/{hook_id} Delete an existing hook.
HooksApi GetAllHooks Get /v2/hooks List all hooks.
Oauth2Api CreateToken Post /oauth2/token Create an access token
SchemasApi GetEditorialStreamingJsonSchema Get /v2/schemas/editorial_streaming.json Editorial Streaming JSON schema
SchemasApi GetSocialStreamingJsonSchema Get /v2/schemas/social_streaming.json Social Streaming JSON schema
SearchesApi GetAllSearches Get /v2/searches List your saved searches.
Swagger_docApi GetCompleteSwaggerSpec Get /v2/swagger_doc Meltwater API Swagger Spec

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

support@api.meltwater.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

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

func (*APIClient) CallAPI

func (c *APIClient) CallAPI(path string, method string,
	postBody interface{},
	headerParams map[string]string,
	queryParams url.Values,
	formParams map[string]string,
	fileName string,
	fileBytes []byte) (*resty.Response, error)

func (*APIClient) ParameterToString

func (c *APIClient) ParameterToString(obj interface{}, collectionFormat string) string

func (*APIClient) SelectHeaderAccept

func (c *APIClient) SelectHeaderAccept(accepts []string) string

func (*APIClient) SelectHeaderContentType

func (c *APIClient) SelectHeaderContentType(contentTypes []string) string

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger 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

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type ClientCredentials

type ClientCredentials struct {

	// Id of the client
	ClientId string `json:"client_id,omitempty"`

	// The secret of the client
	ClientSecret string `json:"client_secret,omitempty"`
}

Register new client Creates a new pair of client credentials (`client_id`/`client_secret` pair). Requires your Meltwater credentials (`email`:`password`) to authenticate. #### Appendix The Base64-encoded `email`:`password` string can be generated in a terminal with following command: $ echo -n \"your_email@your_domain.com:your_secret_password\" | base64 <i>You will need `base64` installed.</i>

type ClientsApi

type ClientsApi struct {
	Configuration *Configuration
}

func NewClientsApi

func NewClientsApi() *ClientsApi

func NewClientsApiWithBasePath

func NewClientsApiWithBasePath(basePath string) *ClientsApi

func (ClientsApi) CreateClientCredentials

func (a ClientsApi) CreateClientCredentials(userKey string, authorization string) (*ClientCredentials, *APIResponse, error)

*

  • Register new client
  • Register new client Creates a new pair of client credentials (&#x60;client_id&#x60;/&#x60;client_secret&#x60; pair). Requires your Meltwater credentials (&#x60;email&#x60;:&#x60;password&#x60;) to authenticate. #### Appendix The Base64-encoded &#x60;email&#x60;:&#x60;password&#x60; string can be generated in a terminal with following command: $ echo -n \&quot;your_email@your_domain.com:your_secret_password\&quot; | base64 &lt;i&gt;You will need &#x60;base64&#x60; installed.&lt;/i&gt; *
  • @param userKey The &#x60;user_key&#x60; from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
  • @param authorization &#x60;email&#x60;:&#x60;password&#x60; Basic Auth (RFC2617) credentials. Must contain the realm &#x60;Basic&#x60; followed by a Base64-encoded &#x60;email&#x60;:&#x60;password&#x60; pair using your Meltwater credentials. #### Example: Basic bXlfZW1haWxAZXhhbXJzZWNyZXQ&#x3D;
  • @return *ClientCredentials

func (ClientsApi) DeleteClientCredentials

func (a ClientsApi) DeleteClientCredentials(userKey string, authorization string, clientId string) (*APIResponse, error)

*

  • Delete client.
  • Delete client. Deletes your current client credentials consisting of client_id and client_secret. After calling this resource, you will not be able to use the Meltwater API unless you create a new set of client credentials! Requires your Meltwater credentials (&#x60;email&#x60;:&#x60;password&#x60;) to authenticate. #### Appendix The Base64-encoded &#x60;email&#x60;:&#x60;password&#x60; string can be generated in a terminal with following command: $ echo -n \&quot;your_email@your_domain.com:your_secret_password\&quot; | base64 &lt;i&gt;You will need &#x60;base64&#x60; installed.&lt;/i&gt; *
  • @param userKey The &#x60;user_key&#x60; from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
  • @param authorization &#x60;email&#x60;:&#x60;password&#x60; Basic Auth (RFC2617) credentials. Must contain the realm &#x60;Basic&#x60; followed by a Base64-encoded &#x60;email&#x60;:&#x60;password&#x60; pair using your Meltwater credentials. #### Example: Basic bXlfZW1haWxAZXhhbXJzZWNyZXQ&#x3D;
  • @param clientId Client ID
  • @return void

type Configuration

type Configuration struct {
	Username      string            `json:"userName,omitempty"`
	Password      string            `json:"password,omitempty"`
	APIKeyPrefix  map[string]string `json:"APIKeyPrefix,omitempty"`
	APIKey        map[string]string `json:"APIKey,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	DebugFile     string            `json:"debugFile,omitempty"`
	OAuthToken    string            `json:"oAuthToken,omitempty"`
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	AccessToken   string            `json:"accessToken,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	APIClient     *APIClient
	Transport     *http.Transport
	Timeout       *time.Duration `json:"timeout,omitempty"`
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

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

func (*Configuration) GetAPIKeyWithPrefix

func (c *Configuration) GetAPIKeyWithPrefix(APIKeyIdentifier string) string

func (*Configuration) GetBasicAuthEncodedString

func (c *Configuration) GetBasicAuthEncodedString() string

type ErrorsCollection

type ErrorsCollection struct {
	Errors []ModelError `json:"errors,omitempty"`
}

List your saved searches.

type Hook

type Hook struct {

	// Search id
	SearchId int32 `json:"search_id,omitempty"`

	// The URL that results from the search will be posted to
	TargetUrl string `json:"target_url,omitempty"`

	Updated string `json:"updated,omitempty"`

	// The type of search the hook is for
	SearchType string `json:"search_type,omitempty"`

	HookId string `json:"hook_id,omitempty"`
}

Creates a hook for one of your predefined searches. Delivers search results for the query referenced by the `search_id` to the `target_url` via HTTP POST. Note that a `hook_id` will be returned on successful creation, this id is needed to delete the hook. We are also returning the header: `X-Hook-Secret`, a shared secret used to sign the document body pushed to your `target_url`. Requires an OAuth access token.

type HooksApi

type HooksApi struct {
	Configuration *Configuration
}

func NewHooksApi

func NewHooksApi() *HooksApi

func NewHooksApiWithBasePath

func NewHooksApiWithBasePath(basePath string) *HooksApi

func (HooksApi) CreateHook

func (a HooksApi) CreateHook(userKey string, authorization string, v2Hooks PostV2Hooks, xHookSecret string) (*Hook, *APIResponse, error)

*

  • Creates a hook for one of your predefined searches.
  • Creates a hook for one of your predefined searches. Delivers search results for the query referenced by the &#x60;search_id&#x60; to the &#x60;target_url&#x60; via HTTP POST. Note that a &#x60;hook_id&#x60; will be returned on successful creation, this id is needed to delete the hook. We are also returning the header: &#x60;X-Hook-Secret&#x60;, a shared secret used to sign the document body pushed to your &#x60;target_url&#x60;. Requires an OAuth access token. *
  • @param userKey The &#x60;user_key&#x60; from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
  • @param authorization &#x60;Oauth Access Token&#x60; OAuth access token (RFC 6749). Must contain the access token type &#x60;Bearer&#x60; followed by an OAuth access token. #### Example: Bearer KKwmfHwxsEoeMDTMAfxOpO...
  • @param v2Hooks
  • @param xHookSecret Shared secret for content signing/verification. The shared secret header is optional and can be provided by the user or will be set by the API. Must be between 16 and 64 characters. Obtain the shared secret from the response header &#x60;X-Hook-Secret&#x60;. #### Example: e2d264b524240b9572ebc2fc7eebd980
  • @return *Hook

func (HooksApi) DeleteHook

func (a HooksApi) DeleteHook(userKey string, authorization string, hookId string) (*APIResponse, error)

*

  • Delete an existing hook.
  • Delete an existing hook. Removes the hook and stops sending any search results to the target_url. Requires an OAuth access token. *
  • @param userKey The &#x60;user_key&#x60; from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
  • @param authorization &#x60;Oauth Access Token&#x60; OAuth access token (RFC 6749). Must contain the access token type &#x60;Bearer&#x60; followed by an OAuth access token. #### Example: Bearer KKwmfHwxsEoeMDTMAfxOpO...
  • @param hookId Hook ID received from creating a hook
  • @return void

func (HooksApi) GetAllHooks

func (a HooksApi) GetAllHooks(userKey string, authorization string) (*HooksCollection, *APIResponse, error)

*

  • List all hooks.
  • List all hooks. Delivers all previously generated hooks. Requires an OAuth access token. *
  • @param userKey The &#x60;user_key&#x60; from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
  • @param authorization &#x60;Oauth Access Token&#x60; OAuth access token (RFC 6749). Must contain the access token type &#x60;Bearer&#x60; followed by an OAuth access token. #### Example: Bearer KKwmfHwxsEoeMDTMAfxOpO...
  • @return *HooksCollection

type HooksCollection

type HooksCollection struct {
	Hooks []Hook `json:"hooks,omitempty"`
}

List all hooks. Delivers all previously generated hooks. Requires an OAuth access token.

type ModelError

type ModelError struct {

	// Human-readable error message.
	Details string `json:"details,omitempty"`

	// Error title
	Title string `json:"title,omitempty"`

	// Error category
	Type_ string `json:"type,omitempty"`

	// Additional meta-information to qualify error
	Meta interface{} `json:"meta,omitempty"`
}

type OAuth2Token

type OAuth2Token struct {

	// The oauth2 access token to use for subsequent API calls
	AccessToken string `json:"access_token,omitempty"`

	// Time until the token expires in seconds
	ExpiresIn int32 `json:"expires_in,omitempty"`

	// The type of oauth2 scope the token is valid for
	Scope string `json:"scope,omitempty"`

	// The type/realm of the access token
	TokenType string `json:"token_type,omitempty"`
}

Create an OAuth2 access token based on the provided `client_id` and `client_secret`. #### Appendix The Base64-encoded `client_id`:`client_secret` string can be generated in a terminal with following command: $ echo -n \"your_client_id:your_client_secret\" | base64 <i>You will need `base64` installed.</i>

type Oauth2Api

type Oauth2Api struct {
	Configuration *Configuration
}

func NewOauth2Api

func NewOauth2Api() *Oauth2Api

func NewOauth2ApiWithBasePath

func NewOauth2ApiWithBasePath(basePath string) *Oauth2Api

func (Oauth2Api) CreateToken

func (a Oauth2Api) CreateToken(userKey string, authorization string, grantType string, scope string) (*OAuth2Token, *APIResponse, error)

*

  • Create an access token
  • Create an OAuth2 access token based on the provided &#x60;client_id&#x60; and &#x60;client_secret&#x60;. #### Appendix The Base64-encoded &#x60;client_id&#x60;:&#x60;client_secret&#x60; string can be generated in a terminal with following command: $ echo -n \&quot;your_client_id:your_client_secret\&quot; | base64 &lt;i&gt;You will need &#x60;base64&#x60; installed.&lt;/i&gt; *
  • @param userKey The &#x60;user_key&#x60; from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
  • @param authorization &#x60;client_id:client_secret&#x60; Basic Auth (RFC2617) credentials. Must contain the realm &#x60;Basic&#x60; followed by a Base64-encoded &#x60;client_id&#x60;:&#x60;client_secret&#x60; pair. #### Example: Basic aAlfbb1haWxDSXhhDXxxZWKJAyZXQ&#x3D;
  • @param grantType OAuth2 grant type, use &#x60;client_credentials&#x60;
  • @param scope OAuth2 scope, use &#x60;search&#x60;
  • @return *OAuth2Token

type PostV2Hooks

type PostV2Hooks struct {

	// Target URL to send article results
	TargetUrl string `json:"target_url"`

	// Search ID
	SearchId int32 `json:"search_id"`
}

Creates a hook for one of your predefined searches.

type SchemasApi

type SchemasApi struct {
	Configuration *Configuration
}

func NewSchemasApi

func NewSchemasApi() *SchemasApi

func NewSchemasApiWithBasePath

func NewSchemasApiWithBasePath(basePath string) *SchemasApi

func (SchemasApi) GetEditorialStreamingJsonSchema

func (a SchemasApi) GetEditorialStreamingJsonSchema(userKey string) (*APIResponse, error)

*

func (SchemasApi) GetSocialStreamingJsonSchema

func (a SchemasApi) GetSocialStreamingJsonSchema(userKey string) (*APIResponse, error)

*

type Search struct {

	// Search id
	SearchId int32 `json:"search_id,omitempty"`

	// Name of the search
	Name string `json:"name,omitempty"`

	// Date time of the last update of the search
	Updated string `json:"updated,omitempty"`

	// The type of results the search returns
	Type_ string `json:"type,omitempty"`
}

type SearchesApi

type SearchesApi struct {
	Configuration *Configuration
}

func NewSearchesApi

func NewSearchesApi() *SearchesApi

func NewSearchesApiWithBasePath

func NewSearchesApiWithBasePath(basePath string) *SearchesApi

func (SearchesApi) GetAllSearches

func (a SearchesApi) GetAllSearches(userKey string, authorization string) (*SearchesCollection, *APIResponse, error)

*

  • List your saved searches.
  • List your saved searches. *
  • @param userKey The &#x60;user_key&#x60; from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
  • @param authorization &#x60;Oauth Access Token&#x60; OAuth access token (RFC 6749). Must contain the access token type &#x60;Bearer&#x60; followed by an OAuth access token. #### Example: Bearer KKwmfHwxsEoeMDTMAfxOpO...
  • @return *SearchesCollection

type SearchesCollection

type SearchesCollection struct {
	Searches []Search `json:"searches,omitempty"`
}

List your saved searches.

type Swagger_docApi

type Swagger_docApi struct {
	Configuration *Configuration
}

func NewSwagger_docApi

func NewSwagger_docApi() *Swagger_docApi

func NewSwagger_docApiWithBasePath

func NewSwagger_docApiWithBasePath(basePath string) *Swagger_docApi

func (Swagger_docApi) GetCompleteSwaggerSpec

func (a Swagger_docApi) GetCompleteSwaggerSpec(userKey string) (*APIResponse, error)

*

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL