TranslateRequest Class

(QtAws::Translate::TranslateRequest)

The TranslateRequest class provides an interface for Translate requests. More...

Header: #include <TranslateRequest>
Inherits: QtAws::Core::AwsAbstractRequest
Inherited By:

QtAws::Translate::TranslateTextRequest

Public Types

enum Action { TranslateTextAction }
flags Actions

Public Functions

TranslateRequest(const Action action)
TranslateRequest(const TranslateRequest &other)
Action action() const
QString actionString() const
QString apiVersion() const
void setAction(const Action action)
void setApiVersion(const QString &version)
TranslateRequest &operator=(const TranslateRequest &other)
virtual bool operator==(const TranslateRequest &other) const

Protected Functions

TranslateRequest(TranslateRequestPrivate * const d)
int clearParameter(const QString &name)
void clearParameters()
QVariant parameter(const QString &name, const QVariant &defaultValue = QVariant()) const
const QVariantMap &parameters() const
void setParameter(const QString &name, const QVariant &value)
void setParameters(const QVariantMap &parameters)

Reimplemented Protected Functions

virtual QNetworkRequest unsignedRequest(const QUrl &endpoint) const override

Detailed Description

The TranslateRequest class provides an interface for Translate requests.

Member Type Documentation

enum TranslateRequest::Action
flags TranslateRequest::Actions

This enum describes the actions that can be performed as Translate requests.

ConstantValueDescription
QtAws::Translate::TranslateRequest::TranslateTextAction0Translate TranslateText action.

The Actions type is a typedef for QFlags<Action>. It stores an OR combination of Action values.

Member Function Documentation

TranslateRequest::TranslateRequest(const Action action)

Constructs a TranslateRequest object for Translate action.

TranslateRequest::TranslateRequest(const TranslateRequest &other)

Constructs a copy of other.

[protected] TranslateRequest::TranslateRequest(TranslateRequestPrivate * const d)

Constructs aa TranslateRequest object with private implementation d.

This overload allows derived classes to provide their own private class implementation that inherits from TranslateRequestPrivate.

Action TranslateRequest::action() const

Returns the Translate action to be performed by this request.

See also setAction().

QString TranslateRequest::actionString() const

Returns the name of the Translate action to be performed by this request.

QString TranslateRequest::apiVersion() const

Returns the Translate API version implemented by this request.

See also setApiVersion().

[protected] int TranslateRequest::clearParameter(const QString &name)

Removes the a name parameter from the request, then returns the number of paramters removed (typically 0 or 1).

[protected] void TranslateRequest::clearParameters()

Removes all parameters from the request.

[protected] QVariant TranslateRequest::parameter(const QString &name, const QVariant &defaultValue = QVariant()) const

Returns the value of the name pararemter if set; defaultValue otherwise.

See also setParameter().

[protected] const QVariantMap &TranslateRequest::parameters() const

Returns the parameters included in this request.

See also setParameters().

void TranslateRequest::setAction(const Action action)

Sets the Translate action to be performed by this request to action.

See also action().

void TranslateRequest::setApiVersion(const QString &version)

Sets the Translate API version to include in this request to version.

See also apiVersion().

[protected] void TranslateRequest::setParameter(const QString &name, const QVariant &value)

Sets the name parameter to value.

See also parameter().

[protected] void TranslateRequest::setParameters(const QVariantMap &parameters)

Sets the paramters for this request to parameters. Any request parameters set previously will be discarded.

See also parameters().

[override virtual protected] QNetworkRequest TranslateRequest::unsignedRequest(const QUrl &endpoint) const

Reimplemented from AwsAbstractRequest::unsignedRequest().

Returns a network request for the Translate request using the given endpoint.

This Translate implementation builds request URLs by combining the common query parameters (such as Action and Version), with any that have been added (via setParameter) by child classes.

TranslateRequest &TranslateRequest::operator=(const TranslateRequest &other)

Sets the TranslateRequest object to be equal to other.

[virtual] bool TranslateRequest::operator==(const TranslateRequest &other) const

Returns true if this request is equal to other; false otherwise.

Note, most derived *Request classes do not need to provider their own implementations of this function, since most such request classes rely on this class' parameters functionality for all request parameters, and that parameters map is already checked via this implementation.

© 2018 Paul Colby Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.