Invokes the /project-xxxx/invite API method.

    For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Project-Permissions-and-Sharing#API-method%3A-%2Fproject-xxxx%2Finvite
333311
def project_invite(object_id, input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/%s/invite' % object_id, input_params, always_retry=always_retry, **kwargs)
873781
def accept_invitation(self, invitation):
        
        assert isinstance(invitation, github.Invitation.Invitation) or isinstance(invitation, int)

        if isinstance(invitation, github.Invitation.Invitation):
            invitation = invitation.id

        headers, data = self._requester.requestJsonAndCheck(
            "PATCH",
            "/user/repository_invitations/" + str(invitation),
            input={}
        )
948128
def Call(method,url,payload=None,session=None,debug=False):
		
		if session is not None:
			token = session['token']
			http_session = session['http_session']

		else:
			if not clc._LOGIN_TOKEN_V2:
				API._Login()
			token = clc._LOGIN_TOKEN_V2
			http_session = clc._REQUESTS_SESSION

		if payload is None:
		    payload = {}

		# If executing refs provided in API they are abs paths,
		# Else refs we build in the sdk are relative
		if url[0]=='/':  fq_url = "%s%s" % (clc.defaults.ENDPOINT_URL_V2,url)
		else:  fq_url = "%s/v2/%s" % (clc.defaults.ENDPOINT_URL_V2,url)

		http_session.headers.update({'Authorization': "Bearer %s" % token})

		if isinstance(payload, basestring):  http_session.headers['content-type'] = "Application/json" # added for server ops with str payload
		else:  http_session.headers['content-type'] = "application/x-www-form-urlencoded"

		if method=="GET":
			r = http_session.request(method,fq_url,
			                     params=payload,
								 verify=API._ResourcePath('clc/cacert.pem'))
		else:
			r = http_session.request(method,fq_url,
			                     data=payload,
								 verify=API._ResourcePath('clc/cacert.pem'))

		if debug:
			API._DebugRequest(request=requests.Request(method,fq_url,data=payload,headers=http_session.headers).prepare(),
			                  response=r)

		if r.status_code>=200 and r.status_code<300:
			try:
				return(r.json())
			except:
				return({})
		else:
			try:
				e = clc.APIFailedResponse("Response code %s.  %s %s %s" %
				                          (r.status_code,r.json()['message'],method,fq_url))
				e.response_status_code = r.status_code
				e.response_json = r.json()
				e.response_text = r.text
				raise(e)
			except clc.APIFailedResponse:
				raise
			except:
				e = clc.APIFailedResponse("Response code %s. %s. %s %s" %
				                         (r.status_code,r.text,method,fq_url))
				e.response_status_code = r.status_code
				e.response_json = {}	# or should this be None?
				e.response_text = r.text
				raise(e)
22708
def update_org_invite(cls, module):
        
        try:
            cls.module_registry[module]["OrgInviteModel"]._meta.get_field("invited_by")
        except FieldDoesNotExist:
            cls.module_registry[module]["OrgInviteModel"].add_to_class(
                "invited_by",
                models.ForeignKey(
                    USER_MODEL,
                    related_name="%(app_label)s_%(class)s_sent_invitations",
                    on_delete=models.CASCADE,
                ),
            )
        try:
            cls.module_registry[module]["OrgInviteModel"]._meta.get_field("invitee")
        except FieldDoesNotExist:
            cls.module_registry[module]["OrgInviteModel"].add_to_class(
                "invitee",
                models.ForeignKey(
                    USER_MODEL,
                    null=True,
                    blank=True,
                    related_name="%(app_label)s_%(class)s_invitations",
                    on_delete=models.CASCADE,
                ),
            )
        try:
            cls.module_registry[module]["OrgInviteModel"]._meta.get_field(
                "organization"
            )
        except FieldDoesNotExist:
            cls.module_registry[module]["OrgInviteModel"].add_to_class(
                "organization",
                models.ForeignKey(
                    cls.module_registry[module]["OrgModel"],
                    related_name="organization_invites",
                    on_delete=models.CASCADE,
                ),
            )
509105
def _parse_invite(client, command, actor, args):
    """"""
    target, _, channel = args.rpartition(" ")
    client.dispatch_event("INVITE", actor, target, channel.lower())
479583
def emit_event(project_slug, action_slug):
    

    if request.headers.get('Content-Type') == 'application/json':
        payload = request.get_json()
    elif request.method == 'POST':
        payload = request.form.to_dict()
    else:
        payload = request.args.to_dict()

    if not request.authorization:
        return jsonify({'message': 'unauthorized'}), 401

    sender_name = request.authorization.username
    sender_secret = request.authorization.password

    event_uuid = request.headers.get('X-Rio-Event-UUID') or \
           request.headers.get('X-B3-TraceId')

    data = _emit_event(project_slug, action_slug, payload, sender_name, sender_secret,
                       event_uuid=event_uuid)
    data['message'] = 'ok'

    event_received.send(None, project_slug=project_slug, data=data)

    return jsonify(data)
596576
def invite_others_to_group(self, group_id, invitees):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - invitees
        """An array of email addresses to be sent invitations."""
        data["invitees"] = invitees

        self.logger.debug("POST /api/v1/groups/{group_id}/invite with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/groups/{group_id}/invite".format(**path), data=data, params=params, no_data=True)
233932
def call(payload=None):
    '''
    
    '''
    r = None
    try:
        if DETAILS['method'] == 'dev_key':
            # Pass the api key without the target declaration
            conditional_payload = {'key': DETAILS['apikey']}
            payload.update(conditional_payload)
            r = __utils__['http.query'](DETAILS['url'],
                                        data=payload,
                                        method='POST',
                                        decode_type='plain',
                                        decode=True,
                                        verify_ssl=False,
                                        status=True,
                                        raise_error=True)
        elif DETAILS['method'] == 'dev_pass':
            # Pass credentials without the target declaration
            r = __utils__['http.query'](DETAILS['url'],
                                        username=DETAILS['username'],
                                        password=DETAILS['password'],
                                        data=payload,
                                        method='POST',
                                        decode_type='plain',
                                        decode=True,
                                        verify_ssl=False,
                                        status=True,
                                        raise_error=True)
        elif DETAILS['method'] == 'pan_key':
            # Pass the api key with the target declaration
            conditional_payload = {'key': DETAILS['apikey'],
                                   'target': DETAILS['serial']}
            payload.update(conditional_payload)
            r = __utils__['http.query'](DETAILS['url'],
                                        data=payload,
                                        method='POST',
                                        decode_type='plain',
                                        decode=True,
                                        verify_ssl=False,
                                        status=True,
                                        raise_error=True)
        elif DETAILS['method'] == 'pan_pass':
            # Pass credentials with the target declaration
            conditional_payload = {'target': DETAILS['serial']}
            payload.update(conditional_payload)
            r = __utils__['http.query'](DETAILS['url'],
                                        username=DETAILS['username'],
                                        password=DETAILS['password'],
                                        data=payload,
                                        method='POST',
                                        decode_type='plain',
                                        decode=True,
                                        verify_ssl=False,
                                        status=True,
                                        raise_error=True)
    except KeyError as err:
        raise salt.exceptions.CommandExecutionError("Did not receive a valid response from host.")

    if not r:
        raise salt.exceptions.CommandExecutionError("Did not receive a valid response from host.")

    if six.text_type(r['status']) not in ['200', '201', '204']:
        if six.text_type(r['status']) == '400':
            raise salt.exceptions.CommandExecutionError(
                "The server cannot process the request due to a client error.")
        elif six.text_type(r['status']) == '401':
            raise salt.exceptions.CommandExecutionError(
                "The server cannot process the request because it lacks valid authentication "
                "credentials for the target resource.")
        elif six.text_type(r['status']) == '403':
            raise salt.exceptions.CommandExecutionError(
                "The server refused to authorize the request.")
        elif six.text_type(r['status']) == '404':
            raise salt.exceptions.CommandExecutionError(
                "The requested resource could not be found.")
        else:
            raise salt.exceptions.CommandExecutionError(
                "Did not receive a valid response from host.")

    xmldata = ET.fromstring(r['text'])

    # If we are pulling the candidate configuration, we need to strip the dirtyId
    if payload['type'] == 'config' and payload['action'] == 'get':
        xmldata = (_strip_dirty(xmldata))

    return xml.to_dict(xmldata, True)
165196
def _send_invitation(request, project):
    
    form = forms.InviteUserApplicationForm(request.POST or None)
    if request.method == 'POST':
        if form.is_valid():

            email = form.cleaned_data['email']
            applicant, existing_person = get_applicant_from_email(email)

            # If applicant is None then there were multiple persons found.
            if applicant is None:
                return render(
                    template_name='kgapplications/'
                                  'project_common_invite_multiple.html',
                    context={'form': form, 'email': email},
                    request=request)

            if existing_person and 'existing' not in request.POST:
                return render(
                    template_name='kgapplications/'
                                  'project_common_invite_existing.html',
                    context={'form': form, 'person': applicant},
                    request=request)

            application = form.save(commit=False)
            application.applicant = applicant
            application.project = project
            application.save()
            state_machine = get_application_state_machine()
            response = state_machine.start(request, application)
            return response

    return render(
        template_name='kgapplications/project_common_invite_other.html',
        context={'form': form, 'project': project, },
        request=request)
806633
def method_missing(method, *args)
      request = RequestBuilder.new(@client)
      request.send(method, *args)
      request
    end
753507
def nps_survey_invitations(self, survey_id, **kwargs):
        ""
        api_path = "/api/v2/nps/surveys/{survey_id}/invitations.json"
        api_path = api_path.format(survey_id=survey_id)
        return self.call(api_path, **kwargs)
332003
def conversations_invite(
        self, *, channel: str, users: List[str], **kwargs
    ) -> SlackResponse:
        
        self._validate_xoxp_token()
        kwargs.update({"channel": channel, "users": users})
        return self.api_call("conversations.invite", json=kwargs)
911217
public Team invitePlayer(long summonerId, TeamId teamId) {
        return client.sendRpcAndWait(SERVICE, "invitePlayer", summonerId, teamId);
    }
550659
def resend_invitations(self):
    

    if not self.id:
      raise TypeError(u"You can't send invites for an event that hasn't been created yet.")

    # Under the hood, this is just an .update() but with no attributes changed.
    # We're going to enforce that by checking if there are any changed attributes and bail if there are
    if self._dirty_attributes:
      raise ValueError(u"There are unsaved changes to this invite - please update it first: %r" % self._dirty_attributes)

    self.refresh_change_key()
    body = soap_request.update_item(self, [], calendar_item_update_operation_type=u'SendOnlyToAll')
    self.service.send(body)

    return self
1359268
def nps_survey_invitation_show(self, survey_id, id, **kwargs):
        ""
        api_path = "/api/v2/nps/surveys/{survey_id}/invitations/{id}.json"
        api_path = api_path.format(survey_id=survey_id, id=id)
        return self.call(api_path, **kwargs)
760522
@Override
	public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException {
		return ((Invocable) engine).invokeMethod(thiz, name, args);
	}
1194493
def send_org_invite(user, invite)
      # Generate token if not generated
      user.send(:generate_confirmation_token!) if !user.confirmed? && user.confirmation_token.blank?

      MnoEnterprise::SystemNotificationMailer.organization_invite(invite).deliver_later

      # Update staged invite status
      invite.status = 'pending' if invite.status == 'staged'
      invite.notification_sent_at = Time.now unless invite.notification_sent_at.present?
      invite.save
    end