সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ক্লাসরুমে একটি Invitation সংস্থান একটি নির্দিষ্ট কোর্সের ভূমিকা সহ একটি কোর্সে যোগদানের জন্য একজন ব্যবহারকারীর জন্য একটি আমন্ত্রণ প্রতিনিধিত্ব করে: ছাত্র, শিক্ষক বা মালিক৷
প্রতিটি Invitation সংস্থানে নিম্নলিখিত ক্ষেত্রগুলি রয়েছে:
id : আমন্ত্রণের জন্য শ্রেণীকক্ষ-নির্ধারিত শনাক্তকারী।
userId : কোর্সে আমন্ত্রিত ব্যবহারকারীর আইডি।
courseId : যে কোর্সটিতে ব্যবহারকারীকে আমন্ত্রণ জানানো হচ্ছে।
role : কোর্সে আমন্ত্রিত ব্যবহারকারীর যে ভূমিকা থাকবে।
একটি আমন্ত্রণ তৈরি করুন
invitations.create() পদ্ধতিটি একটি নির্দিষ্ট ভূমিকা সহ একটি কোর্সে একজন ব্যবহারকারীকে আমন্ত্রণ জানাতে ব্যবহার করা যেতে পারে। অনুরোধের অংশে Invitation সংস্থান অন্তর্ভুক্ত করুন এবং courseId , userId এবং role নির্দিষ্ট করুন।
Invitationinvitation=null;try{/* Set the role the user is invited to have in the course. Possible values of CourseRole can be found here: https://developers.google.com/classroom/reference/rest/v1/invitations#courserole.*/Invitationcontent=newInvitation().setCourseId(courseId).setUserId(userId).setRole("TEACHER");invitation=service.invitations().create(content).execute();System.out.printf("User (%s) has been invited to course (%s).\n",invitation.getUserId(),invitation.getCourseId());}catch(GoogleJsonResponseExceptione){// TODO (developer) - handle error appropriatelyGoogleJsonErrorerror=e.getDetails();if(error.getCode()==404){System.out.printf("The course or user does not exist.\n");}throwe;}catch(Exceptione){throwe;}returninvitation;
একটি আমন্ত্রণ পুনরুদ্ধার করুন
invitations.get() পদ্ধতিতে কল করে এবং আমন্ত্রণের id উল্লেখ করে একটি নির্দিষ্ট আমন্ত্রণ পুনরুদ্ধার করুন।
Invitationinvitation=null;try{invitation=service.invitations().get(id).execute();System.out.printf("Invitation (%s) for user (%s) in course (%s) retrieved.\n",invitation.getId(),invitation.getUserId(),invitation.getCourseId());}catch(GoogleJsonResponseExceptione){GoogleJsonErrorerror=e.getDetails();if(error.getCode()==404){System.out.printf("The invitation id (%s) does not exist.\n",id);}throwe;}catch(Exceptione){throwe;}returninvitation;
একটি আমন্ত্রণ গ্রহণ করুন
একটি আমন্ত্রণ গ্রহণ করলে আমন্ত্রণটি মুছে যায় এবং আমন্ত্রিত ব্যবহারকারীকে আমন্ত্রণে নির্দিষ্ট ভূমিকা সহ কোর্সে যোগ করে। invitations.accept() পদ্ধতিতে কল করে এবং আমন্ত্রণের id উল্লেখ করে একটি আমন্ত্রণ গ্রহণ করুন।
try{service.invitations().accept(id).execute();System.out.printf("Invitation (%s) was accepted.\n",id);}catch(GoogleJsonResponseExceptione){GoogleJsonErrorerror=e.getDetails();if(error.getCode()==404){System.out.printf("The invitation id (%s) does not exist.\n",id);}throwe;}catch(Exceptione){throwe;}
একটি আমন্ত্রণ মুছুন
একটি আমন্ত্রণ আপডেট করার একমাত্র উপায় এটি মুছে ফেলা এবং একটি নতুন আমন্ত্রণ তৈরি করা৷ আমন্ত্রণটি মুছতে, invitations.delete() পদ্ধতিতে কল করুন এবং id নির্দিষ্ট করুন।
try{service.invitations().delete(id).execute();System.out.printf("Invitation (%s) was deleted.\n",id);}catch(GoogleJsonResponseExceptione){GoogleJsonErrorerror=e.getDetails();if(error.getCode()==404){System.out.printf("The invitation id (%s) does not exist.\n",id);}throwe;}catch(Exceptione){throwe;}
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-01-14 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["An Invitation resource in Classroom allows users to join a course with a specific role, containing fields like `id`, `userId`, `courseId`, and `role`."],["You can create, retrieve, accept, and delete invitations using the Classroom API's `invitations` methods, specifying necessary parameters like `courseId`, `userId`, `role`, and `id`."],["Accepting an invitation adds the user to the course with the specified role and deletes the invitation, while deleting an invitation requires using the `invitations.delete()` method."],["Updating an invitation involves deleting the existing one and creating a new one with the desired changes."]]],[]]