syntax = "proto3";

package com.wixpress.authorization;

import "google/protobuf/wrappers.proto";
import "wix/api/permissions.proto";
import "wix/api/entity.proto";

service MetaSiteRestrictedSubjectsFacade {
    option (wix.api.service_entity).message = "com.wixpress.authorization.RestrictedSubject";

    rpc getRestrictedSubjects(GetRestrictedSubjectsRequest) returns (GetRestrictedSubjectsResponse) {
        option (wix.api.permission).name = "AUTHORIZATION.GET_RESTRICTED_TEAM_MEMBERS";
    }
}

message GetRestrictedSubjectsRequest {
    repeated string meta_site_ids = 1;
}

message GetRestrictedSubjectsResponse {
    repeated SiteRestrictedSubjects site_restricted_subjects = 1;
}

message SiteRestrictedSubjects {
    string meta_site_id = 1;
    repeated RestrictedSubject subjects = 2;
}

message RestrictedSubject {
    option (.wix.api.entity) = {
        fqdn: "wix.identity.authorization.v1.restricted_subject"
        segment: USERS
    };
    oneof subject {
        RestrictedTeamMember restricted_team_member = 1;
        Contributor contributor = 2;
    }
}

message RestrictedTeamMember {
    string id = 1;
    google.protobuf.StringValue account_id = 2;
}

message Contributor {
    string id = 1;
}
