Class UsageRule
Usage configuration rules for the service.
NOTE: Under development.
Use this rule to configure unregistered calls for the service. Unregistered
calls are calls that do not contain consumer project identity.
(Example: calls that do not contain an API key).
By default, API methods do not allow unregistered calls, and each method call
must be identified by a consumer project identity. Use this rule to
allow/disallow unregistered calls.
Example of an API that wants to allow unregistered calls for entire service.
usage:
rules:
- selector: "*"
allow_unregistered_calls: true
Example of a method that wants to allow unregistered calls.
usage:
rules:
- selector: "google.example.library.v1.LibraryService.CreateBook"
allow_unregistered_calls: true
Inheritance
System.Object
UsageRule
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class UsageRule : IMessage<UsageRule>, IMessage, IEquatable<UsageRule>, IDeepCloneable<UsageRule>
Constructors
UsageRule()
Declaration
UsageRule(UsageRule)
Declaration
public UsageRule(UsageRule other)
Parameters
Fields
AllowUnregisteredCallsFieldNumber
Field number for the "allow_unregistered_calls" field.
Declaration
public const int AllowUnregisteredCallsFieldNumber = 2
Field Value
Type |
Description |
System.Int32 |
|
SelectorFieldNumber
Field number for the "selector" field.
Declaration
public const int SelectorFieldNumber = 1
Field Value
Type |
Description |
System.Int32 |
|
SkipServiceControlFieldNumber
Field number for the "skip_service_control" field.
Declaration
public const int SkipServiceControlFieldNumber = 3
Field Value
Type |
Description |
System.Int32 |
|
Properties
AllowUnregisteredCalls
If true, the selected method allows unregistered calls, e.g. calls
that don't identify any user or application.
Declaration
public bool AllowUnregisteredCalls { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Descriptor
Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Parser
Declaration
public static MessageParser<UsageRule> Parser { get; }
Property Value
Selector
Selects the methods to which this rule applies. Use '*' to indicate all
methods in all APIs.
Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
Declaration
public string Selector { get; set; }
Property Value
Type |
Description |
System.String |
|
SkipServiceControl
If true, the selected method should skip service control and the control
plane features, such as quota and billing, will not be available.
This flag is used by Google Cloud Endpoints to bypass checks for internal
methods, such as service health check methods.
Declaration
public bool SkipServiceControl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
CalculateSize()
Declaration
public int CalculateSize()
Returns
Type |
Description |
System.Int32 |
|
Implements
Clone()
Declaration
Returns
Implements
Equals(UsageRule)
Declaration
public bool Equals(UsageRule other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>.Equals(T)
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
MergeFrom(UsageRule)
Declaration
public void MergeFrom(UsageRule other)
Parameters
Implements
Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Implements
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
WriteTo(CodedOutputStream)
Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Implements
Explicit Interface Implementations
IMessage.Descriptor
Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Implements