syntax = "proto3";

package devvit.data.api.admin.v1alpha;

import "google/protobuf/timestamp.proto";

option go_package = "github.snooguts.net/reddit/devplatform-api/go/grpc/devvit/data/api/admin/v1alpha";

message Organization {
  string id = 1;
  string name = 2;
  bool is_internal = 3;
  google.protobuf.Timestamp contract_end_date = 4;
}

message CreateOrganizationRequest {
  string name = 1;
  bool is_internal = 2;
  google.protobuf.Timestamp contract_end_date = 3;
}

message CreateOrganizationResponse {
  Organization organization = 1;
}

message DeleteOrganizationRequest {
  string id = 1;
}

message DeleteOrganizationResponse {
  Organization organization = 1;
}

message GetOrganizationByNameRequest {
  string name = 1;
}

message GetOrganizationByNameResponse {
  Organization organization = 1;
}

message GetOrganizationByIdRequest {
  string id = 1;
}

message GetOrganizationByIdResponse {
  Organization organization = 1;
}

message GetOrganizationsRequest {}

message GetOrganizationsResponse {
  repeated Organization organizations = 1;
}

message UpdateOrganizationByIdRequest {
  string id = 1;
  bool is_internal = 2;
}

message UpdateOrganizationResponse {
  Organization organization = 1;
}
