তৈরি করুন & একটি লেবেল প্রকাশ করুন

This page describes how to create and publish a label.

একটি লেবেল তৈরি করুন

To create a label, use the create method on the labels collection. Labels can optionally contain one or more Fields .

আপনাকে আরও নির্দিষ্ট করে বলতে হবে:

  • একটি LabelType

  • property মেথডের মাধ্যমে একটি লেবেলের title

  • useAdminAccess is true to use the user's administrator credentials. The server verifies that the user is an admin with the "Manage Labels" privilege before allowing access.

This example creates a standard, admin label with a specified title and one SelectionOptions Field with 2 Choices .

পাইথন

label_body = {
'label_type': 'ADMIN',
'properties': {
    'title': 'TITLE'
},
'fields': [{
    'properties': {
        'display_name': 'DISPLAY_NAME'
    },
    'selection_options': {
        'list_options': {},
        'choices': [{
            'properties': {
                'display_name': 'CHOICE_1'
            }
        }, {
            'properties': {
                'display_name': 'CHOICE_2'
            }
        }]
    }
}]
}
response = service.labels().create(
    body=label_body, useAdminAccess=True).execute()

নোড.জেএস

var label = {
'label_type': 'ADMIN',
'properties': {
    'title': 'TITLE'
},
'fields': [{
    'properties': {
    'display_name': 'DISPLAY_NAME'
    },
    'selection_options': {
    'list_options': {},
    'choices': [{
        'properties': {
        'display_name': 'CHOICE_1'
        }
    }, {
        'properties': {
        'display_name': 'CHOICE_2'
        }
    }]
    }
}]
};

service.labels.create({
  'resource': label,
  'use_admin_access': true
}, (err, res) => {
if (err) return console.error('The API returned an error: ' + err);
  console.log(res);
});

The label is created in the UNPUBLISHED_DRAFT State . It must be PUBLISHED for use on files and to be visible to users. For more information, see Label lifecycle .

লেবেল সীমা

The following limits apply when creating and applying labels:

  • স্ট্যান্ডার্ড লেবেল—১৫০
  • প্রতি লেবেলে ক্ষেত্র—১০
  • প্রতি ফাইলে ব্যবহারকারী-প্রদত্ত লেবেল—৫

লেবেলে ফিল্ড নিয়ে কাজ করা

Field Type ব্যবহারকারীরা যা করতে পারেন বিন্যাস সংক্রান্ত বিবেচ্য বিষয় এবং সীমাবদ্ধতা
SelectionOptions তালিকা থেকে এক বা একাধিক বিকল্প নির্বাচন করুন সর্বোচ্চ ২০০টি অপশন সমর্থন করা হয়।
Maximum number of selections for a file is 10 as configured in ListOptions
IntegerOptions একটি সংখ্যাসূচক মান লিখুন শুধুমাত্র পূর্ণ সংখ্যা সমর্থিত
DateOptions একটি ক্যালেন্ডার তারিখ নির্বাচন করুন (Optional) Date format can be set to “Long: Month DD, YYYY”, or “Short: MM/DD/YY“
TextOptions টেক্সট বক্সে টেক্সট লিখুন সর্বোচ্চ ১০০টি অক্ষর সমর্থন করা হয়।
UserOptions Select one or more users from Google Workspace contacts. Maximum number of user entries for a file is 10 as configured in ListOptions

একটি লেবেল প্রকাশ করুন

The Labels API lets you publish a draft label once it's complete.

To publish a label, use the publish method and specify:

  • A Label resource that represents every label. It contains a resource Name and ID , which is a globally unique identifier for the label.

  • useAdminAccess is true to use the user's administrator credentials. The server verifies that the user is an admin with the "Manage Labels" privilege before allowing access.

This example uses the ID to identify and publish the correct label.

পাইথন

service.labels().publish(
name='labels/ID',
body={
  'use_admin_access': True
}).execute()

নোড.জেএস

service.labels.publish({
  'resource': {
    'use_admin_access': true
},
'name': 'labels/ID'
}, (err, res) => {
  if (err) return console.error('The API returned an error: ' + err);
  console.log(res);
});

লেবেলটি প্রকাশিত হয়ে গেলে, এটি 'প্রকাশিত' PUBLISHED State চলে যায় এবং এর রিভিশন আইডি এক বৃদ্ধি পায়। এরপর লেবেলটি ব্যবহারকারীদের কাছে দৃশ্যমান হয় এবং ফাইলগুলিতে প্রয়োগ করা যায়। আরও তথ্যের জন্য, লেবেল জীবনচক্র (Label lifecycle ) দেখুন।

লেবেল প্রকাশ করার ক্ষেত্রে সীমাবদ্ধতা

  • Once published, a label cannot return to its original draft state. For more information, see Label lifecycle .

  • Publishing a label creates a newly published revision. All previous draft revisions are deleted. Previously published revisions are kept but are subject to automated deletion as needed.

  • একবার প্রকাশিত হয়ে গেলে, কিছু পরিবর্তন আর অনুমোদিত থাকে না। সাধারণত, এর অর্থ হলো লেবেল সম্পর্কিত বিদ্যমান মেটাডেটাকে অবৈধ করে বা তার উপর নতুন বিধিনিষেধ আরোপ করে এমন যেকোনো পরিবর্তন প্রত্যাখ্যান করা হয়। উদাহরণস্বরূপ, একটি লেবেল প্রকাশিত হওয়ার পর তাতে নিম্নলিখিত পরিবর্তনগুলি অনুমোদিত নয়:

    • The label is directly deleted. (It must be disabled first, then deleted.)
    • Field.FieldType পরিবর্তন করা হয়েছে।
    • Updates to the Field validation options reject something previously accepted.
    • সর্বোচ্চ অংশগ্রহণের সংখ্যা হ্রাস করা হয়েছে।