Create a room

@see http://api.hipchat.com/docs/api/method/rooms/create
965851
public function create_room($name, $owner_user_id = null, $privacy = null, $topic = null, $guest_access = null) {
     $args = array(
       'name' => $name
     );

     if ($owner_user_id) {
       $args['owner_user_id'] = $owner_user_id;
     }

     if ($privacy) {
       $args['privacy'] = $privacy;
     }

     if ($topic) {
       $args['topic'] = $topic;
     }

     if ($guest_access) {
       $args['guest_access'] = (int)$guest_access;
     }

     // Return the std object
     return $this->make_request('rooms/create', $args, 'POST');
    }
999486
public function boot()
    {
        $this->app->when(HipChatChannel::class)
            ->needs(HipChat::class)
            ->give(function () {
                return new HipChat(
                    new HttpClient,
                    config('services.hipchat.url'),
                    config('services.hipchat.token'),
                    config('services.hipchat.room')
                );
            });
    }
135655
public function create()
    {
        /**
         * @var Order $order
         */
        $classNamespace = $this->getEntityNamespace();
        $order = new $classNamespace();
        $order
            ->setQuantity(0)
            ->setWidth(0)
            ->setHeight(0)
            ->setWidth(0)
            ->setWeight(0)
            ->setCreatedAt($this->now())
            ->setPurchasableAmount($this->createZeroAmountMoney())
            ->setAmount($this->createZeroAmountMoney())
            ->setCouponAmount($this->createZeroAmountMoney())
            ->setShippingAmount($this->createZeroAmountMoney());

        $paymentStateLineStack = $this
            ->paymentMachineManager
            ->initialize(
                $order,
                StateLineStack::create(
                    new ArrayCollection(),
                    null
                ),
                'Order not paid'
            );

        $order->setPaymentStateLineStack($paymentStateLineStack);

        $shippingStateLineStack = $this
            ->shippingMachineManager
            ->initialize(
                $order,
                StateLineStack::create(
                    new ArrayCollection(),
                    null
                ),
                'Preparing Order'
            );

        $order->setShippingStateLineStack($shippingStateLineStack);

        return $order;
    }
528529
public function createRoom($ownerId, $roomName = null)
    {
        $params['owner_id'] = $ownerId;
        if (!empty($roomName)) {
            $params['room_name'] = $roomName;
        }
        $body = json_encode($params);
        try {
            $ret = $this->_transport->send(HttpRequest::POST, $this->_baseURL, $body);
        } catch (\Exception $e) {
            return $e;
        }
        return $ret;
    }
789434
public function create()
	{
		try
		{
			$this->client->send(new Request($this->uri->withPath($this->uri->getPath().'resources')
				->withQuery(http_build_query([
					'path' => $this->getPath()
				], null, '&')), 'PUT'));
			$this->setContents([]);
		}
		catch (\Exception $exc)
		{
			throw $exc;
		}

		return $this;
	}
1198260
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new ClassWithStringProperty();
			case 1:
				return new ClassWithStringProperty(func_get_arg(0));
			case 2:
				return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1));
			case 3:
				return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new ClassWithStringProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
959202
public function hipchat(Request $request)
    {
        $this->validate($request, [
            'hipchattoken' => 'required|string|min:1|max:80',
            'roomid' => 'required|string|min:4|max:7',
            'low' => 'required|boolean',
            'medium' => 'required|boolean',
            'high' => 'required|boolean',
        ]);

        Recipient::create([
            'type' => 'hipchat',
            'address' => $request->roomid,
            'meta' => ['token' => $request->hipchattoken],
            'low' => $request->low,
            'medium' => $request->medium,
            'high' => $request->high,
        ]);

        return redirect(route('eyewitness.settings.index').'#recipients')->withSuccess('The HipChat recipient has been created. You can send a test notification to ensure it is working by click on the button next to the recipient.');
    }
846839
public JSONObject createRoom(String company, HashMap<String, String> params) throws JSONException {
        return oClient.post("/messages/v3/" + company + "/rooms", params);
    }
878457
private function createNewPost()
	{
		if (!$this->user->role->hasPermission('create'))
			throw new CHttpException(403, Yii::t('Api.content', 'You do not have permission to create new entries.'));

		$model = new Content;

		$model->populate($_POST);

		// Return a model instance to work with
		if ($model->savePrototype($this->user->id))
		{
			return $model->getAPIAttributes(array(
					'category_id',
					'parent_id',
					'author_id'
				),
				array(
					'author' => array(
						'password',
						'activation_key',
						'email',
						'about',
						'user_role',
						'status',
						'created',
						'updated'
					),
					'category' => array(
						'parent_id'
					),
					'metadata' => array(
						'content_id'
					)
				));
		}

		return $this->returnError(400, NULL, $model->getErrors());
	}
163087
def CreateChatWith(self, *Usernames):
        
        return Chat(self, chop(self._DoCommand('CHAT CREATE %s' % ', '.join(Usernames)), 2)[1])
890089
function(params, callback) {
        /**
         * Callback for QB.chat.dialog.create().
         * @param {Object} error - The error object
         * @param {Object} createdDialog - the dialog object
         * @callback createDialogCallback
         * */

        if (params && params.occupants_ids && Utils.isArray(params.occupants_ids)) {
            params.occupants_ids = params.occupants_ids.join(', ');
        }

        this.service.ajax({
            url: Utils.getUrl(DIALOGS_API_URL),
            type: 'POST',
            data: params
        }, callback);
    }
25551
def room(id, &callback)
      http(:get, "/room/#{id}.json") do |data, http|
        Firering::Room.instantiate(self, data, :room, &callback)
      end
    end
1171087
public function actionCreate()
    {
        $user = new User();
        $this->readValue($user, 'username');
        $this->readValue($user, 'email');
        $user->setPassword($this->prompt('Password:', [
            'required' => true,
            'pattern'  => '#^.{6,255}$#i',
            'error'    => 'More than 6 symbols',
        ]));
        $user->generateAuthKey();
        $user->status = User::STATUS_ACTIVE;
        $this->log($this->repository->save($user));
    }
416345
public function addRoom(\Ydle\HubBundle\Entity\Room $rooms)
    {
        $this->rooms[] = $rooms;

        return $this;
    }
831040
def message(self, body, room_id, style='text'):
        '''  '''
        # TODO Automatically detect body format ?
        path = 'rooms/message'
        data = {
            'room_id': room_id,
            'message': body,
            'from': self.name,
            'notify': 1,
            'message_format': style,
            'color': self.bg_color
        }
        log.info('sending message to hipchat', message=body, room=room_id)
        feedback = self._api_call(path, data, requests.post)
        log.debug(feedback)
        return feedback
562046
public static function create()
    {
        $coID = Coroutine::getuid();
        if(!isset(static::$context[$coID]))
        {
            static::$context[$coID] = [];
            Event::trigger('IMI.REQUEST_CONTENT.CREATE');
        }
        else
        {
            throw new \RuntimeException('Create context failed, cannot create a duplicate context');
        }
    }
363323
public function init(array $options = [])
    {
        if (!$this->isOnline()) {
            return false;
        }

        // Merge $options with Config settings.
        $options = $this->mergeConfig($options);
        $room = $this->createRoom(
            $options['room_name'],
            $options['owner_user_id']
        );

        // Split the hash from the room's Guest Access URL
        $room->hipsupport_hash = $this->getHashFromUrl($room->guest_access_url);

        // Append the HipChat web client parameters.
        $room->hipsupport_url = $this->appendUrlOptions(
            $room->guest_access_url,
            $options
        );

        // Notify the given room that a new room has been created.
        $this->notify($options, $room);

        return $room;
    }