امور را مدیریت کنید

یک موضوع، ظرفی برای داده‌های مربوط به یک موضوع خاص، مانند یک پرونده قضایی یا یک تحقیق است. یک موضوع شامل موارد زیر است:

  • عبارات جستجوی ذخیره شده
  • نگه می‌دارد
  • حساب‌هایی که موضوع با آنها در میان گذاشته شده است
  • مجموعه‌های خروجی
  • دنباله حسابرسی

برای کار با منابع Google Vault، یک حساب کاربری باید امتیازات لازم Vault و دسترسی به موضوع را داشته باشد. برای دسترسی به یک موضوع، یک حساب کاربری باید آن موضوع را ایجاد کرده باشد، موضوع را با آنها به اشتراک گذاشته باشد یا امتیاز مشاهده همه موضوعات را داشته باشد.

یک ماده دارای حالات زیر است:

ایالت توضیحات
باز این موضوع فعال است و می‌توانید در آن فایل‌های ذخیره ایجاد کنید، جستجو انجام دهید و داده‌ها را صادر کنید.
بسته معمولاً وقتی تحقیقات کامل می‌شود، موضوع بسته می‌شود. موضوعات بسته شده را می‌توان در هر زمانی دوباره بررسی کرد. قبل از بستن یک موضوع، تمام موانع مرتبط با آن را حذف کنید.
حذف شده می‌توان یک موضوع را طوری حذف کرد که کاملاً از دسترس خارج شود. یک موضوع حذف شده تقریباً به مدت 30 روز در سطل زباله باقی می‌ماند و در این مدت می‌توان آن را بازیابی کرد. پس از این مدت، موضوع به طور دائم پاک می‌شود. فقط موضوعات بسته شده را می‌توان حذف کرد.

چرخه حیات اهمیت دارد

ایجاد یک موضوع

مثال زیر یک موضوع جدید با نام و توضیحات ایجاد می‌کند.

جاوا

Matter matter = new Matter();
matter.setName("Matter Name");
matter.setDescription("Matter Description");
Matter createdMatter = client.matters().create(matter).execute();
 

پایتون

def create_matter(service):
  matter_content = {
      'name': 'Matter Name',
      'description': 'Matter Description',
  }
  matter = service.matters().create(body=matter_content).execute()
  return matter

یه موضوع رو بفرمایید

دو نمای کلی از یک موضوع وجود دارد: BASIC (پیش‌فرض) و FULL . نمای FULL مجوزهای موضوع را به نمای BASIC اضافه می‌کند.

مثال زیر موضوع مشخص شده را بازیابی می‌کند.

جاوا

client.matters().get(matterId).execute(); // Returns BASIC view.
client.matters().get(matterId).setView("BASIC").execute();
client.matters().get(matterId).setView("FULL").execute();

پایتون

matter_id = getMatterId()
service.matters().get(matterId=matter_id).execute(); // Returns BASIC view.
service.matters().get(matterId=matter_id, view='BASIC').execute();
service.matters().get(matterId=matter_id, view='FULL').execute();

فهرست کردن مهم است

مثال زیر نحوه فهرست کردن همه موضوعات باز، بسته و حذف شده را نشان می‌دهد. به طور پیش‌فرض، API در هر درخواست تا ۱۰۰ موضوع را برمی‌گرداند.

جاوا

List mattersList = client.matters().list().execute().getMatters();

پایتون

mattersList = service.matters().list().execute()

مثال زیر نحوه فهرست کردن تمام موارد باز، بسته و حذف شده را در چندین درخواست نشان می‌دهد.

جاوا

ListMattersResponse firstPageResponse = client.matters().list().setPageSize(20).execute();

String nextPageToken = firstPageResponse.getNextPageToken();
if (nextPageToken != null) {
  client.matters().list().setPageToken(nextPageToken).setPageSize(20).execute();
}

پایتون

list_response1 = service.matters().list(
        view='FULL', pageSize=10).execute()
for matter in list_response1['matters']:
    print(matter)

if 'nextPageToken' in list_response1:
    list_response2 = service.matters().list(
        pageSize=10, pageToken=list_response1['nextPageToken']).execute()
    for matter in list_response2['matters']:
      print(matter)

مثال زیر نحوه فهرست کردن موارد مربوط به یک حالت مشخص را نشان می‌دهد.

جاوا

// Only get open matters.
List openMattersList = client.matters().list().setState("OPEN")
    .execute().getMatters();

// Only get closed matters.
List closedMattersList = client.matters().list().setState("CLOSED")
    .execute().getMatters();

// Only get deleted matters.
List deletedMattersList = client.matters().list().setState("DELETED")
    .execute().getMatters();

پایتون

# Only get open matters.
openMattersList = client.matters().list(
    state='OPEN').execute()

# Only get closed matters.
closedMattersList = client.matters().list(
    state='CLOSED').execute()

# Only get deleted matters.
deletedMattersList = client.matters().list(
    state='DELETED').execute()

به‌روزرسانی یک موضوع

مثال زیر نام و توضیحات یک موضوع را به‌روزرسانی می‌کند.

جاوا

String matterId = "matterId";
Matter matter = new Matter().setName("New Name")
    .setDescription("New Description");
client.matters().update(matterId, matter).execute();

پایتون

def update_matter(service, matter_id):
    wanted_matter = {
        'name': 'New Matter Name',
        'description': 'New Description'
    }
    updated_matter = service.matters().update(
        matterId=matter_id, body=wanted_matter).execute()
    return updated_matter

بستن یک موضوع

مثال زیر نحوه بستن یک موضوع را نشان می‌دهد.

جاوا

String matterId = "matterId";
// If the matter still has holds, this operation will fail.
client.matters().close(matterId, new CloseMatterRequest()).execute();
 

پایتون

def close_matter(service, matter_id):
    close_response = service.matters().close(
        matterId=matter_id, body={}).execute()
    return close_response['matter']
 

حذف، بازگردانی یا بازگشایی یک موضوع

مثال زیر نحوه حذف، بازیابی یا بازگشایی یک موضوع را نشان می‌دهد.

جاوا

Matter matter = client.matters().get(matterId).execute();

// Delete the matter.
client.matters().delete(matter.getMatterId());
// Undelete the matter.
client.matters().undelete(matter.getMatterId(), new UndeleteRequest());
// Reopen the matter.
client.matters().reopen(matter.getMatterId(), new ReopenMatterRequest());
 

پایتون

def reopen_matter(service, matter_id):
    reopen_response = service.matters().reopen(
        matterId=matter_id, body={}).execute()
    return reopen_response['matter']

def delete_matter(service, matter_id):
    service.matters().delete(matterId=matter_id).execute()
    return get_matter(matter_id)

def undelete_matter(service, matter_id):
    undeleted_matter = service.matters().undelete(
        matterId=matter_id, body={}).execute()
    return undeleted_matter
 

مجوزهای مهم

هر موضوع دارای مجموعه‌ای از مجوزهایی است که مشخص می‌کند چه کسی می‌تواند به آن دسترسی داشته باشد یا آن را ویرایش کند. می‌توانید با مشاهده‌ی FULL یک موضوع، این مجوزها را مشاهده کنید.

جاوا

String matterId = "Matter Id";
String accountId = "Account Id";

// List permissions for a matter.
Matter matter = client.matters().get(matterId).setView("FULL").execute();
List matterPermissions = matter.getMatterPermissions();

// Add a user to the permission set.
client
    .matters()
    .addPermissions(matterId)
    .setMatterPermissionAccountId(accountId)
    .setMatterPermissionRole("COLLABORATOR")
    .execute();

// Remove a user from the permission set.
client
    .matters()
    .removePermissions(matterId)
    .setAccountId(accountId)
    .execute();

پایتون

def list_matter_permission(service, matter_id):
    matter = service.matters().get(matterId=matter_id, view='FULL').execute()
    return matter['matterPermissions']

def add_matter_permission(service, matter_id, account_id):
    permission = service.matters().addPermissions(
        matterId=matter_id,
        matterPermission_accountId=account_id,
        matterPermission_role='COLLABORATOR',
        sendEmails='False',
        ccMe='False').execute()
    return permission

def remove_matter_permission(service, matter_id, account_id):
    service.matters().removePermissions(
        matterId=matter_id, accountId=account_id).execute()