syntax = "proto3";

package com.wixpress.authorization.abac.management.typed;

import "google/api/annotations.proto";
import "wix/api/validations.proto";
import "wix/api/annotations.proto";
import "wix/api/permissions.proto";
import "wix/api/entity.proto";


service AppPoliciesManagementService {
    option (wix.api.service_entity).message = "com.wixpress.authorization.abac.management.typed.AccountPolicyAssignment";
    option (wix.api.service_exposure) = INTERNAL;

    rpc ClearAssignedAppPolicies (ClearAssignedAppPoliciesRequest) returns (ClearAssignedAppPoliciesResponse) {
        option (wix.api.required) = "ClearAssignedAppPoliciesRequest.account_id";
        option (wix.api.required) = "ClearAssignedAppPoliciesRequest.app_id";
        option (google.api.http).delete = "/v1/app/{app_id}/account/{account_id}/assigned-policies";
        option (.wix.api.permission) = {
            name: "DEV_CENTER.REMOVE_APP_CONTRIBUTOR"
            type: MANUAL
        };
    }
}

message ClearAssignedAppPoliciesRequest {
    //account id to clear its assigned policies
    string account_id = 1 [(wix.api.format) = GUID];
    //app id to clear its assigned policies
    string app_id = 2 [(wix.api.format) = GUID];
}

message ClearAssignedAppPoliciesResponse {
    repeated string deleted_assignment_ids = 1 [(wix.api.format) = GUID];
}