Cloud Build V1 API - Class Google::Api::RoutingParameter (v0.26.0)

Reference documentation and code samples for the Cloud Build V1 API class Google::Api::RoutingParameter.

A projection from an input message to the GRPC or REST header.

Inherits

  • Object

Extended By

  • Google::Protobuf::MessageExts::ClassMethods

Includes

  • Google::Protobuf::MessageExts

Methods

#field

def field() -> ::String
Returns
  • (::String) — A request field to extract the header key-value pair from.

#field=

def field=(value) -> ::String
Parameter
  • value (::String) — A request field to extract the header key-value pair from.
Returns
  • (::String) — A request field to extract the header key-value pair from.

#path_template

def path_template() -> ::String
Returns
  • (::String) — A pattern matching the key-value field. Optional. If not specified, the whole field specified in the field field will be taken as value, and its name used as key. If specified, it MUST contain exactly one named segment (along with any number of unnamed segments) The pattern will be matched over the field specified in the field field, then if the match is successful:

    • the name of the single named segment will be used as a header name,
    • the match value of the segment will be used as a header value; if the match is NOT successful, nothing will be sent.

    Example:

              -- This is a field in the request message
             |   that the header value will be extracted from.
             |
             |                     -- This is the key name in the
             |                    |   routing header.
             V                    |
    field: "table_name"           v
    path_template: "projects/*/{table_location=instances/*}/tables/*"
                                               ^            ^
                                               |            |
      In the {} brackets is the pattern that --             |
      specifies what to extract from the                    |
      field as a value to be sent.                          |
                                                            |
     The string in the field must match the whole pattern --
     before brackets, inside brackets, after brackets.
    

    When looking at this specific example, we can see that:

    • A key-value pair with the key table_location and the value matching instances/* should be added to the x-goog-request-params routing header.
    • The value is extracted from the request message's table_name field if it matches the full pattern specified: projects/*/instances/*/tables/*.

    NB: If the path_template field is not provided, the key name is equal to the field name, and the whole field should be sent as a value. This makes the pattern for the field and the value functionally equivalent to **, and the configuration

    {
      field: "table_name"
    }
    

    is a functionally equivalent shorthand to:

    {
      field: "table_name"
      path_template: "{table_name=**}"
    }
    

    See Example 1 for more details.

#path_template=

def path_template=(value) -> ::String
Parameter
  • value (::String) — A pattern matching the key-value field. Optional. If not specified, the whole field specified in the field field will be taken as value, and its name used as key. If specified, it MUST contain exactly one named segment (along with any number of unnamed segments) The pattern will be matched over the field specified in the field field, then if the match is successful:

    • the name of the single named segment will be used as a header name,
    • the match value of the segment will be used as a header value; if the match is NOT successful, nothing will be sent.

    Example:

              -- This is a field in the request message
             |   that the header value will be extracted from.
             |
             |                     -- This is the key name in the
             |                    |   routing header.
             V                    |
    field: "table_name"           v
    path_template: "projects/*/{table_location=instances/*}/tables/*"
                                               ^            ^
                                               |            |
      In the {} brackets is the pattern that --             |
      specifies what to extract from the                    |
      field as a value to be sent.                          |
                                                            |
     The string in the field must match the whole pattern --
     before brackets, inside brackets, after brackets.
    

    When looking at this specific example, we can see that:

    • A key-value pair with the key table_location and the value matching instances/* should be added to the x-goog-request-params routing header.
    • The value is extracted from the request message's table_name field if it matches the full pattern specified: projects/*/instances/*/tables/*.

    NB: If the path_template field is not provided, the key name is equal to the field name, and the whole field should be sent as a value. This makes the pattern for the field and the value functionally equivalent to **, and the configuration

    {
      field: "table_name"
    }
    

    is a functionally equivalent shorthand to:

    {
      field: "table_name"
      path_template: "{table_name=**}"
    }
    

    See Example 1 for more details.

Returns
  • (::String) — A pattern matching the key-value field. Optional. If not specified, the whole field specified in the field field will be taken as value, and its name used as key. If specified, it MUST contain exactly one named segment (along with any number of unnamed segments) The pattern will be matched over the field specified in the field field, then if the match is successful:

    • the name of the single named segment will be used as a header name,
    • the match value of the segment will be used as a header value; if the match is NOT successful, nothing will be sent.

    Example:

              -- This is a field in the request message
             |   that the header value will be extracted from.
             |
             |                     -- This is the key name in the
             |                    |   routing header.
             V                    |
    field: "table_name"           v
    path_template: "projects/*/{table_location=instances/*}/tables/*"
                                               ^            ^
                                               |            |
      In the {} brackets is the pattern that --             |
      specifies what to extract from the                    |
      field as a value to be sent.                          |
                                                            |
     The string in the field must match the whole pattern --
     before brackets, inside brackets, after brackets.
    

    When looking at this specific example, we can see that:

    • A key-value pair with the key table_location and the value matching instances/* should be added to the x-goog-request-params routing header.
    • The value is extracted from the request message's table_name field if it matches the full pattern specified: projects/*/instances/*/tables/*.

    NB: If the path_template field is not provided, the key name is equal to the field name, and the whole field should be sent as a value. This makes the pattern for the field and the value functionally equivalent to **, and the configuration

    {
      field: "table_name"
    }
    

    is a functionally equivalent shorthand to:

    {
      field: "table_name"
      path_template: "{table_name=**}"
    }
    

    See Example 1 for more details.