syntax = "proto3";
package cosmos.authz.v1beta1;

import "cosmos_proto/cosmos.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/authz/types";

// GenericAuthorization gives the grantee unrestricted permissions to execute
// the provided method on behalf of the granter's account.
message GenericAuthorization {
  option (cosmos_proto.implements_interface) = "Authorization";

  // method name to grant unrestricted permissions to execute
  // Note: MethodName() is already a method on `GenericAuthorization` type,
  // we need some custom naming here so using `MessageName`
  string method_name = 1 [(gogoproto.customname) = "MessageName"];
}

// AuthorizationGrant gives permissions to execute
// the provide method with expiration time.
message AuthorizationGrant {
  google.protobuf.Any       authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"];
  google.protobuf.Timestamp expiration    = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
}
