Show / Hide Table of Contents

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
Implements
IMessage<UsageRule>
IMessage
System.IEquatable<UsageRule>
IDeepCloneable<UsageRule>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class UsageRule : IMessage<UsageRule>, IMessage, IEquatable<UsageRule>, IDeepCloneable<UsageRule>

Constructors

UsageRule()

Declaration
public UsageRule()

UsageRule(UsageRule)

Declaration
public UsageRule(UsageRule other)
Parameters
Type Name Description
UsageRule other

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
Type Description
MessageDescriptor

Parser

Declaration
public static MessageParser<UsageRule> Parser { get; }
Property Value
Type Description
MessageParser<UsageRule>

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
IMessage.CalculateSize()

Clone()

Declaration
public UsageRule Clone()
Returns
Type Description
UsageRule
Implements
IDeepCloneable<T>.Clone()

Equals(UsageRule)

Declaration
public bool Equals(UsageRule other)
Parameters
Type Name Description
UsageRule other
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
Type Name Description
UsageRule other
Implements
IMessage<T>.MergeFrom(T)

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor
Back to top