From 73d5ba0d2d541c5dde59fda50454f57ae8dbe7f0 Mon Sep 17 00:00:00 2001 From: Victor Vazquez Date: Tue, 25 May 2021 14:02:14 -0700 Subject: [PATCH] Doc changes for HTTP and removing the "More" link (#2332) * update docs from classes * remove more link from classes part II * http docs * Update sdk/core/azure-core/inc/azure/core/http/http.hpp Co-authored-by: Rick Winter * Update cmake-modules/AzureDoxygen.cmake * doc updates * update RFC Co-authored-by: Rick Winter --- cmake-modules/AzureDoxygen.cmake | 2 + .../azure-core/inc/azure/core/context.hpp | 3 - .../azure/core/credentials/credentials.hpp | 4 - .../inc/azure/core/diagnostics/logger.hpp | 1 - .../inc/azure/core/dll_import_export.hpp | 8 -- sdk/core/azure-core/inc/azure/core/etag.hpp | 3 +- .../azure-core/inc/azure/core/exception.hpp | 1 - .../inc/azure/core/http/curl_transport.hpp | 2 - .../azure-core/inc/azure/core/http/http.hpp | 80 ++++++++++++++++--- .../inc/azure/core/http/http_status_code.hpp | 1 - .../inc/azure/core/http/policies/policy.hpp | 3 - .../inc/azure/core/http/raw_response.hpp | 4 +- .../inc/azure/core/http/transport.hpp | 1 - .../azure/core/http/win_http_transport.hpp | 2 - .../azure/core/internal/client_options.hpp | 1 - .../core/internal/json/json_serializable.hpp | 1 - .../inc/azure/core/internal/strings.hpp | 1 - .../inc/azure/core/io/body_stream.hpp | 2 - .../inc/azure/core/operation_status.hpp | 1 - sdk/core/azure-core/inc/azure/core/url.hpp | 5 +- sdk/core/azure-core/inc/azure/core/uuid.hpp | 1 - .../fault-injector/fault_injector_test.cpp | 1 - .../inc/azure/core/test/nullable_test.hpp | 1 - 23 files changed, 76 insertions(+), 53 deletions(-) diff --git a/cmake-modules/AzureDoxygen.cmake b/cmake-modules/AzureDoxygen.cmake index 1f82847d8..aee51eb07 100644 --- a/cmake-modules/AzureDoxygen.cmake +++ b/cmake-modules/AzureDoxygen.cmake @@ -38,6 +38,8 @@ function(generate_documentation PROJECT_NAME PROJECT_VERSION) # Use MathJax instead of latex to render formulas set(DOXYGEN_USE_MATHJAX YES) + set(DOXYGEN_REPEAT_BRIEF NO) + doxygen_add_docs(${PROJECT_NAME}-docs ALL COMMENT "Generate documentation for ${PROJECT_NAME}") diff --git a/sdk/core/azure-core/inc/azure/core/context.hpp b/sdk/core/azure-core/inc/azure/core/context.hpp index 149924c02..fe4ec5c3f 100644 --- a/sdk/core/azure-core/inc/azure/core/context.hpp +++ b/sdk/core/azure-core/inc/azure/core/context.hpp @@ -23,7 +23,6 @@ namespace Azure { namespace Core { /** * @brief An exception thrown when an operation is cancelled. - * */ class OperationCancelledException final : public std::runtime_error { public: @@ -39,13 +38,11 @@ namespace Azure { namespace Core { /** * @brief A context is a node within a tree that represents deadlines and key/value pairs. - * */ class Context final { public: /** * @brief A key used to store and retrieve data in an #Azure::Core::Context object. - * */ class Key final { Key const* m_uniqueAddress; diff --git a/sdk/core/azure-core/inc/azure/core/credentials/credentials.hpp b/sdk/core/azure-core/inc/azure/core/credentials/credentials.hpp index d2cc32650..db1362014 100644 --- a/sdk/core/azure-core/inc/azure/core/credentials/credentials.hpp +++ b/sdk/core/azure-core/inc/azure/core/credentials/credentials.hpp @@ -22,7 +22,6 @@ namespace Azure { namespace Core { namespace Credentials { /** * @brief An access token is used to authenticate requests. - * */ struct AccessToken final { @@ -41,7 +40,6 @@ namespace Azure { namespace Core { namespace Credentials { /** * @brief Context for getting token. - * */ struct TokenRequestContext final { @@ -54,7 +52,6 @@ namespace Azure { namespace Core { namespace Credentials { /** * @brief A base type of credential that uses Azure::Core::AccessToken to authenticate requests. - * */ class TokenCredential { public: @@ -84,7 +81,6 @@ namespace Azure { namespace Core { namespace Credentials { /** * @brief An exception that gets thrown when an authentication error occurs. - * */ class AuthenticationException final : public std::exception { std::string m_message; diff --git a/sdk/core/azure-core/inc/azure/core/diagnostics/logger.hpp b/sdk/core/azure-core/inc/azure/core/diagnostics/logger.hpp index 55217a11e..4af93c970 100644 --- a/sdk/core/azure-core/inc/azure/core/diagnostics/logger.hpp +++ b/sdk/core/azure-core/inc/azure/core/diagnostics/logger.hpp @@ -14,7 +14,6 @@ namespace Azure { namespace Core { namespace Diagnostics { /** * @brief Log message handler. - * */ class Logger final { public: diff --git a/sdk/core/azure-core/inc/azure/core/dll_import_export.hpp b/sdk/core/azure-core/inc/azure/core/dll_import_export.hpp index c1cbd80f5..a4130fa07 100644 --- a/sdk/core/azure-core/inc/azure/core/dll_import_export.hpp +++ b/sdk/core/azure-core/inc/azure/core/dll_import_export.hpp @@ -97,46 +97,39 @@ /** * @brief Azure SDK abstractions. - * */ namespace Azure { /** * @brief Abstractions commonly used by Azure SDK client libraries. - * */ namespace Core { /** * @brief Credential-related abstractions. - * */ namespace Credentials { } /** * @brief Cryptography-related abstractions. - * */ namespace Cryptography { } /** * @brief Diagnostics-related abstractions, such as logging. - * */ namespace Diagnostics { } /** * @brief Abstractions related to HTTP transport layer. - * */ namespace Http { /** * @brief Abstractions related to controlling the behavior of HTTP requests. - * */ namespace Policies { } @@ -144,7 +137,6 @@ namespace Core { /** * @brief Abstractions related to communications with Azure. - * */ namespace IO { } diff --git a/sdk/core/azure-core/inc/azure/core/etag.hpp b/sdk/core/azure-core/inc/azure/core/etag.hpp index d4de57880..52558257f 100644 --- a/sdk/core/azure-core/inc/azure/core/etag.hpp +++ b/sdk/core/azure-core/inc/azure/core/etag.hpp @@ -17,7 +17,6 @@ namespace Azure { /** * @brief Represents an HTTP validator. - * */ class ETag final { // ETag is a validator based on https://tools.ietf.org/html/rfc7232#section-2.3.2 @@ -135,7 +134,7 @@ public: */ bool HasValue() const { return m_value.HasValue(); } - /* + /** * @brief Returns the resource metadata represented as a string. * @return #std::string */ diff --git a/sdk/core/azure-core/inc/azure/core/exception.hpp b/sdk/core/azure-core/inc/azure/core/exception.hpp index 55baa46ee..bbf589985 100644 --- a/sdk/core/azure-core/inc/azure/core/exception.hpp +++ b/sdk/core/azure-core/inc/azure/core/exception.hpp @@ -19,7 +19,6 @@ namespace Azure { namespace Core { /** * @brief An error while trying to send a request to Azure service. - * */ class RequestFailedException : public std::runtime_error { public: diff --git a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp index cd899640d..74759ab2e 100644 --- a/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/curl_transport.hpp @@ -36,7 +36,6 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Set the libcurl connection options like a proxy and CA path. - * */ struct CurlTransportOptions final { @@ -93,7 +92,6 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Concrete implementation of an HTTP Transport that uses libcurl. - * */ class CurlTransport final : public HttpTransport { private: diff --git a/sdk/core/azure-core/inc/azure/core/http/http.hpp b/sdk/core/azure-core/inc/azure/core/http/http.hpp index eee0fe1a0..09d45cb09 100644 --- a/sdk/core/azure-core/inc/azure/core/http/http.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/http.hpp @@ -51,8 +51,8 @@ namespace Azure { namespace Core { namespace Http { /********************* Exceptions **********************/ /** - * @brief HTTP transport layer error. - * + * @brief Consistent interface to handle errors occurred while performing an HTTP + * Request. */ class TransportException final : public Azure::Core::RequestFailedException { public: @@ -71,9 +71,9 @@ namespace Azure { namespace Core { namespace Http { }; /** - * @brief Defines a range of bytes within an HTTP resource, starting at an `Offset` and ending at - * `Offset + Length - 1` inclusively. + * @brief The range of bytes within an HTTP resource. * + * @note Starts at an `Offset` and ends at `Offset + Length - 1` inclusively. */ struct HttpRange final { @@ -91,22 +91,76 @@ namespace Azure { namespace Core { namespace Http { }; /** - * HTTP request method. - * + * @brief The method to be performed on the resource identified by the Request. */ class HttpMethod final { public: HttpMethod() = delete; + + /** + * @brief Constructs a new HttpMethod from a given string. + * + * @note Won't check if \p value is a known HttpMethod defined as per any RFC. + * + * @param value A given string to represent the HttpMethod. + */ explicit HttpMethod(std::string value) : m_value(std::move(value)) {} + + /** + * @brief Compares two instances of `HttpMethod` for equality. + * + * @param other Some `HttpMethod` instance to compare with. + * @return `true` if instances are equal; otherwise, `false`. + */ bool operator==(const HttpMethod& other) const { return m_value == other.m_value; } + + /** + * @brief Compares two instances of `HttpMethod` for equality. + * + * @param other Some `HttpMethod` instance to compare with. + * @return `false` if instances are equal; otherwise, `true`. + */ bool operator!=(const HttpMethod& other) const { return !(*this == other); } + + /** + * @brief Returns the HttpMethod represented as a string. + */ const std::string& ToString() const { return m_value; } + /** + * @brief The representation of a `GET` HttpMethod based on [RFC 7231] + * (https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.1). + */ AZ_CORE_DLLEXPORT const static HttpMethod Get; + + /** + * @brief The representation of a `HEAD` HttpMethod based on [RFC 7231] + * (https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.2). + */ AZ_CORE_DLLEXPORT const static HttpMethod Head; + + /** + * @brief The representation of a `POST` HttpMethod based on [RFC 7231] + * (https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.3). + */ AZ_CORE_DLLEXPORT const static HttpMethod Post; + + /** + * @brief The representation of a `PUT` HttpMethod based on [RFC 7231] + * (https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.4). + */ AZ_CORE_DLLEXPORT const static HttpMethod Put; + + /** + * @brief The representation of a `DELETE` HttpMethod based on [RFC 7231] + * (https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5). + */ AZ_CORE_DLLEXPORT const static HttpMethod Delete; + + /** + * @brief The representation of a `PATCH` HttpMethod based on [RFC 5789] + * (https://datatracker.ietf.org/doc/html/rfc5789). + */ AZ_CORE_DLLEXPORT const static HttpMethod Patch; private: @@ -118,8 +172,10 @@ namespace Azure { namespace Core { namespace Http { }} // namespace Policies::_internal /** - * @brief HTTP request. + * @brief A request message from a client to a server. * + * @details Includes, within the first line of the message, the HttpMethod to be applied to the + * resource, the URL of the resource, and the protocol version in use. */ class Request final { friend class Azure::Core::Http::Policies::_internal::RetryPolicy; @@ -160,7 +216,7 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Construct an #Azure::Core::Http::Request. * - * @param httpMethod HTTP method. + * @param httpMethod HttpMethod. * @param url URL. * @param bodyStream #Azure::Core::IO::BodyStream. * @param shouldBufferResponse A boolean value indicating whether the returned response should @@ -180,7 +236,7 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Construct an #Azure::Core::Http::Request. * - * @param httpMethod HTTP method. + * @param httpMethod HttpMethod. * @param url URL. * @param bodyStream #Azure::Core::IO::BodyStream. */ @@ -193,7 +249,7 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Construct an #Azure::Core::Http::Request. * - * @param httpMethod HTTP method. + * @param httpMethod HttpMethod. * @param url URL. * @param shouldBufferResponse A boolean value indicating whether the returned response should * be buffered or returned as a body stream instead. @@ -203,7 +259,7 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Construct an #Azure::Core::Http::Request. * - * @param httpMethod HTTP method. + * @param httpMethod HttpMethod. * @param url URL. */ explicit Request(HttpMethod httpMethod, Url url); @@ -230,7 +286,7 @@ namespace Azure { namespace Core { namespace Http { // Methods used by transport layer (and logger) to send request /** - * @brief Get HTTP method. + * @brief Get HttpMethod. * */ HttpMethod GetMethod() const; diff --git a/sdk/core/azure-core/inc/azure/core/http/http_status_code.hpp b/sdk/core/azure-core/inc/azure/core/http/http_status_code.hpp index f4ea558f3..97f2a73bd 100644 --- a/sdk/core/azure-core/inc/azure/core/http/http_status_code.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/http_status_code.hpp @@ -13,7 +13,6 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Defines the possible HTTP status codes. - * */ enum class HttpStatusCode { diff --git a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp index 918864ace..611e494df 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policies/policy.hpp @@ -45,7 +45,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { /** * @brief Telemetry options, used to configure telemetry parameters. * @note See https://azure.github.io/azure-sdk/general_azurecore.html#telemetry-policy. - * */ struct TelemetryOptions final { @@ -121,7 +120,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { /** * @brief HTTP transport options parameterize the HTTP transport adapter being used. - * */ struct TransportOptions final { @@ -260,7 +258,6 @@ namespace Azure { namespace Core { namespace Http { namespace Policies { /** * @brief HTTP retry policy. - * */ class RetryPolicy #if !defined(TESTING_BUILD) diff --git a/sdk/core/azure-core/inc/azure/core/http/raw_response.hpp b/sdk/core/azure-core/inc/azure/core/http/raw_response.hpp index 3ae416b2e..5bcfcca08 100644 --- a/sdk/core/azure-core/inc/azure/core/http/raw_response.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/raw_response.hpp @@ -18,8 +18,8 @@ namespace Azure { namespace Core { namespace Http { /** - * @brief Raw HTTP response. - * + * @brief After receiving and interpreting a request message, a server responds with an HTTP + * response message. */ class RawResponse final { diff --git a/sdk/core/azure-core/inc/azure/core/http/transport.hpp b/sdk/core/azure-core/inc/azure/core/http/transport.hpp index ea2b46719..630643c73 100644 --- a/sdk/core/azure-core/inc/azure/core/http/transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/transport.hpp @@ -15,7 +15,6 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Base class for all HTTP transport implementations. - * */ class HttpTransport { public: diff --git a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp index aec624345..4cf2a86e4 100644 --- a/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/win_http_transport.hpp @@ -125,7 +125,6 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Sets the WinHTTP session and connection options used to customize the behavior of the * transport. - * */ struct WinHttpTransportOptions final { @@ -135,7 +134,6 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Concrete implementation of an HTTP transport that uses WinHTTP when sending and * receiving requests and responses over the wire. - * */ class WinHttpTransport final : public HttpTransport { private: diff --git a/sdk/core/azure-core/inc/azure/core/internal/client_options.hpp b/sdk/core/azure-core/inc/azure/core/internal/client_options.hpp index 50a89c9f6..da28683d7 100644 --- a/sdk/core/azure-core/inc/azure/core/internal/client_options.hpp +++ b/sdk/core/azure-core/inc/azure/core/internal/client_options.hpp @@ -20,7 +20,6 @@ namespace Azure { namespace Core { namespace _internal { /** * @brief Base type for all client option types, exposes various common client options like Retry * and Transport. - * */ struct ClientOptions { diff --git a/sdk/core/azure-core/inc/azure/core/internal/json/json_serializable.hpp b/sdk/core/azure-core/inc/azure/core/internal/json/json_serializable.hpp index 104d8f85b..9d7a233bd 100644 --- a/sdk/core/azure-core/inc/azure/core/internal/json/json_serializable.hpp +++ b/sdk/core/azure-core/inc/azure/core/internal/json/json_serializable.hpp @@ -15,7 +15,6 @@ namespace Azure { namespace Core { namespace Json { namespace _internal { /** * @brief Interface for json-serializable components. - * */ class JsonSerializable { public: diff --git a/sdk/core/azure-core/inc/azure/core/internal/strings.hpp b/sdk/core/azure-core/inc/azure/core/internal/strings.hpp index 745718c7a..d6e68d2e1 100644 --- a/sdk/core/azure-core/inc/azure/core/internal/strings.hpp +++ b/sdk/core/azure-core/inc/azure/core/internal/strings.hpp @@ -16,7 +16,6 @@ namespace Azure { namespace Core { namespace _internal { /** * @brief Extend the functionality of std::string by offering static methods for string * operations. - * */ struct StringExtensions final { diff --git a/sdk/core/azure-core/inc/azure/core/io/body_stream.hpp b/sdk/core/azure-core/inc/azure/core/io/body_stream.hpp index 2679ea5bb..d6f0db3de 100644 --- a/sdk/core/azure-core/inc/azure/core/io/body_stream.hpp +++ b/sdk/core/azure-core/inc/azure/core/io/body_stream.hpp @@ -27,7 +27,6 @@ namespace Azure { namespace Core { namespace IO { /** * @brief Used to read data to/from a service. - * */ class BodyStream { private: @@ -117,7 +116,6 @@ namespace Azure { namespace Core { namespace IO { /** * @brief #Azure::Core::IO::BodyStream providing data from an initialized memory buffer. - * */ class MemoryBodyStream final : public BodyStream { private: diff --git a/sdk/core/azure-core/inc/azure/core/operation_status.hpp b/sdk/core/azure-core/inc/azure/core/operation_status.hpp index aa355d857..618dd8677 100644 --- a/sdk/core/azure-core/inc/azure/core/operation_status.hpp +++ b/sdk/core/azure-core/inc/azure/core/operation_status.hpp @@ -20,7 +20,6 @@ namespace Azure { namespace Core { /** * @brief Long-running operation states. - * */ class OperationStatus final { std::string m_value; diff --git a/sdk/core/azure-core/inc/azure/core/url.hpp b/sdk/core/azure-core/inc/azure/core/url.hpp index f81986b6f..3a5fb5f21 100644 --- a/sdk/core/azure-core/inc/azure/core/url.hpp +++ b/sdk/core/azure-core/inc/azure/core/url.hpp @@ -40,8 +40,9 @@ namespace Azure { namespace Core { /** * @brief Represents the location where a request will be performed. - * It can be parsed and initialized from a string that contains all URL components (scheme, host, - * path, etc.). Authority is not currently supported. + * + * @details It can be parsed and initialized from a string that contains all URL components + * (scheme, host, path, etc.). Authority is not currently supported. */ class Url final { private: diff --git a/sdk/core/azure-core/inc/azure/core/uuid.hpp b/sdk/core/azure-core/inc/azure/core/uuid.hpp index 8d198e25b..3af3f0351 100644 --- a/sdk/core/azure-core/inc/azure/core/uuid.hpp +++ b/sdk/core/azure-core/inc/azure/core/uuid.hpp @@ -23,7 +23,6 @@ namespace Azure { namespace Core { /** * @brief Universally unique identifier. - * */ class Uuid final { diff --git a/sdk/core/azure-core/test/fault-injector/fault_injector_test.cpp b/sdk/core/azure-core/test/fault-injector/fault_injector_test.cpp index e4a3ffe66..d89d4a0e7 100644 --- a/sdk/core/azure-core/test/fault-injector/fault_injector_test.cpp +++ b/sdk/core/azure-core/test/fault-injector/fault_injector_test.cpp @@ -37,7 +37,6 @@ struct FaultInjectionClientOptions /** * @brief An special http policy to redirect requests to the Fault injector server. - * */ class FaultInjectionClient : public Azure::Core::Http::HttpTransport { private: diff --git a/sdk/core/azure-core/test/perf/inc/azure/core/test/nullable_test.hpp b/sdk/core/azure-core/test/perf/inc/azure/core/test/nullable_test.hpp index 5cdb538bd..969815298 100644 --- a/sdk/core/azure-core/test/perf/inc/azure/core/test/nullable_test.hpp +++ b/sdk/core/azure-core/test/perf/inc/azure/core/test/nullable_test.hpp @@ -17,7 +17,6 @@ namespace Azure { namespace Core { namespace Test { /** * @brief Measure the Nullable object performance. - * */ class NullableTest : public Azure::Perf::PerfTest { public: