github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/meeting/v1/conferences/requests.go (about) 1 package conferences 2 3 import ( 4 "github.com/chnsz/golangsdk" 5 ) 6 7 type CreateOpts struct { 8 // The conference start time (UTC time). 9 // When creating a reservation conference, if the start time is not specified or the blank string is filled in, it 10 // means that the conference will start immediately. 11 // The time is in UTC, which is the time in time zone 0. 12 // Format: yyyy-MM-dd HH:mm 13 StartTime string `json:"startTime,omitempty"` 14 // The duration of the conference, in minutes, with a maximum value of 1440 and a minimum value of 15. 15 // The default is 30. 16 Length int `json:"length,omitempty"` 17 // Conference subject. The length is limited to 128 characters. 18 Subject string `json:"subject,omitempty"` 19 // The media type of the conference. 20 // It consists of one or more enumeration Strings. When there are multiple enumerations, each enumeration value is 21 // separated by "," commas. The enumeration values are as follows: 22 // "Voice": Voice. 23 // "Video": SD video. 24 // "HDVideo": High-definition video (mutually exclusive with Video, if Video and HDVideo are selected at the same 25 // time, the system will select Video by default). 26 // "Telepresence": Telepresence (mutually exclusive with HDVideo and Video, if selected at the same time, the 27 // system uses Telepresence). (reserved field) 28 // "Data": Multimedia (system configuration determines whether to automatically add Data). 29 MediaTypes string `json:"mediaTypes,omitempty"` 30 // When the soft terminal creates an instant conference, it carries a temporary group ID in the current field, which 31 // is carried by the server in the conference-info header field when inviting other participants. 32 // The length is limited to 31 characters. 33 Groupuri string `json:"groupuri,omitempty"` 34 // Attendee list. This list can be used to send conference notifications, conference reminders, and automatic invitations 35 // when the conference starts. 36 Participants []Participant `json:"attendees,omitempty"` 37 // The parameter of the cyclical conference. When the conference is a periodic conference, this parameter must be filled in, 38 // otherwise the server ignores this parameter. 39 // This parameter includes the start date, end date of the periodic conference, the period of the conference and the 40 // conference time point in the period. 41 CycleParams *CycleParams `json:"cycleParams,omitempty"` 42 // Whether the conference automatically starts recording, it only takes effect when the recording type is: 43 // 1: Automatically start recording. 44 // 0: Do not start recording automatically. 45 // The default is not to start automatically. 46 IsAutoRecord *int `json:"isAutoRecord,omitempty"` 47 // Conference media encryption mode. 48 // 0: Adaptive encryption. 49 // 1: Force encryption. 50 // 2: Do not encrypt. 51 // Default values are populated by enterprise-level configuration. 52 EncryptMode *int `json:"encryptMode,omitempty"` 53 // The default language of the conference, the default value is defined by the conference cloud service. 54 // For languages supported by the system, it is passed according to the RFC3066 specification. 55 // zh-CN: Simplified Chinese. 56 // en-US: US English. 57 Language string `json:"language,omitempty"` 58 // The time zone information of the conference time in the conference notification. 59 // For time zone information, refer to the time zone mapping relationship. 60 // For example: "timeZoneID":"26", the time in the conference notification sent through HUAWEI CLOUD conference will be 61 // marked as "2021/11/11 Thursday 00:00 - 02:00 (GMT) Greenwich Standard When: Dublin, Edinburgh, Lisbon, London". 62 // For an aperiodic conference, if the conference notification is sent through a third-party system, this field does not 63 // need to be filled in. 64 TimeZoneID string `json:"timeZoneID,omitempty"` 65 // Recording type. 66 // 0: Disabled. 67 // 1: Live broadcast. 68 // 2: Record and broadcast. 69 // 3: Live + Recording. 70 // Default is disabled. 71 RecordType *int `json:"recordType,omitempty"` 72 // The mainstream live broadcast address, with a maximum of 255 characters. 73 // It is valid when the recording type is 2 or 3. 74 LiveAddress string `json:"liveAddress,omitempty"` 75 // Auxiliary streaming address, the maximum length is 255 characters. 76 // It is valid when the recording type is 2 or 3. 77 AuxAddress string `json:"auxAddress,omitempty"` 78 // Whether to record auxiliary stream. 79 // 0: Do not record. 80 // 1: Record. 81 // It is valid when the recording type is 2 or 3. 82 RecordAuxStream *int `json:"recordAuxStream,omitempty"` 83 // Other configuration information for the conference. 84 Configuration *Configuration `json:"confConfigInfo,omitempty"` 85 // Recording authentication method. 86 // 0: Viewable/downloadable via link. 87 // 1: Enterprise users can watch/download. 88 // 2: Attendees can watch/download. 89 // It is valid when the recording type is 2 or 3. 90 RecordAuthType *int `json:"recordAuthType,omitempty"` 91 // Whether to use the cloud conference room or personal conference ID to hold a reservation conference. 92 // 0: Do not use cloud conference room. 93 // 1: Use cloud conference room or personal conference ID. 94 // Cloud conference rooms are not used by default. 95 VmrFlag *int `json:"vmrFlag,omitempty"` 96 // VMR ID bound to the current founding account. 97 // Obtained by querying the cloud conference room and personal conference ID interface. 98 // Note: 99 // vmrID takes the ID returned in the above query interface, not vmrId. 100 // When creating a conference with a personal conference ID, use VMR with vmrMode=0; 101 // When creating a conference in a cloud conference room, use VMR with vmrMode=1. 102 VmrId string `json:"vmrID,omitempty"` 103 // The number of parties in the conference, the maximum number of participants in the conference. 104 // 0: Unlimited. 105 // Greater than 0: the maximum number of participants in the conference. 106 ConcurrentParticipants *int `json:"concurrentParticipants,omitempty"` 107 // The authorization token. 108 Token string `json:"-" required:"true"` 109 } 110 111 type Participant struct { 112 // User UUID of the participant. 113 UserUUID string `json:"userUUID,omitempty"` 114 // The account ID of the participant. 115 // If it is an account/password authentication scenario, optional, indicating the ID of the HUAWEI CLOUD conference 116 // account. If it is an APP ID authentication scenario, it is required, indicating the user ID of the third party, 117 // and the appid parameter needs to be carried. 118 AccountId string `json:"accountId,omitempty"` 119 // App ID, application identification, an application only needs to be created once, refer to "App ID application" 120 // If it is an APP ID authentication scenario, this item is required. 121 AppId string `json:"appId,omitempty"` 122 // Attendee name or nickname. The length is limited to 96 characters. 123 Name string `json:"name,omitempty"` 124 // The role in the conference. The default is a regular participant. 125 // 0: Normal attendees. 126 // 1: The conference host. 127 Role *int `json:"role,omitempty"` 128 // If it is an account/password authentication scenario, it is required to fill in the number (SIP and TEL number 129 // formats can be supported). Maximum of 127 characters. At least one of phone, email and sms must be filled in. 130 // If it is an APP ID authentication scenario, optional. 131 Phone string `json:"phone,omitempty"` 132 // Email address. Maximum of 255 characters. In the case of account/password authentication, at least one of phone, 133 // email, and sms must be filled in. (Information notification for reservation, modification and cancellation of 134 // conference) 135 Email string `json:"email,omitempty"` 136 // Mobile number for SMS notification. Maximum of 32 characters. In the case of account/password authentication, at 137 // least one of phone, email, and sms must be filled in. (Information notification for reservation, modification and 138 // cancellation of conference) 139 SMS string `json:"sms,omitempty"` 140 // Whether the user needs to be automatically muted when joining the conference (only effective when invited in the 141 // conference). Unmuted by default. 142 // 0: No mute required. 143 // 1: Mute is required. 144 IsMute *int `json:"isMute,omitempty"` 145 // Whether to automatically invite this participant when the conference starts. The default value is determined by the 146 // enterprise-level configuration. 147 // 0: Do not automatically invite. 148 // 1: Automatic invitation. 149 IsAutoInvite *int `json:"isAutoInvite,omitempty"` 150 // The default value is defined by the conference AS. The number type enumeration is as follows: 151 // normal: Soft terminal. 152 // telepresence: Telepresence. Single-screen and triple-screen telepresence belong to this category. (reserved field) 153 // terminal: conference room or hard terminal. 154 // outside: The outside participant. 155 // mobile: User's mobile phone number. 156 // telephone: The user's landline phone. (reserved field) 157 // ideahub: ideahub. 158 Type string `json:"type,omitempty"` 159 // Department ID. Maximum of 64 characters. 160 DeptUUID string `json:"deptUUID,omitempty"` 161 // Department name. Maximum of 128 characters. 162 DeptName string `json:"deptName,omitempty"` 163 } 164 165 type CycleParams struct { 166 // The start date of the recurring conference, format: YYYY-MM-DD. 167 // The start date cannot be earlier than the current date. 168 // The date is the date in the time zone specified by timeZoneID, not the date in UTC time. 169 StartDate string `json:"startDate,omitempty"` 170 // End date of the recurring conference, format: YYYY-MM-DD. 171 // The maximum time interval between start date and end date cannot exceed 1 year. 172 // A maximum of 50 subconferences are allowed between the start date and the end date. 173 // If there are more than 50 subconferences, the end date will be automatically adjusted. 174 // The date is the date in the time zone specified by timeZoneID, not the date in UTC time. 175 EndDate string `json:"endDate,omitempty"` 176 // Period type. The valid values are: 177 // Day 178 // Week 179 // Month 180 Cycle string `json:"cycle,omitempty"` 181 // If the cycle selects "Day", which means that it will be held every few days, and the value range is [1,15]. 182 // If the cycle selects "Week", which means that it is held every few weeks, and the value range is [1,5]. 183 // If the cycle selects "Month", Interval means every few months, the value range is [1,3]. 184 Interval int `json:"interval,omitempty"` 185 // The conference point in the cycle. Only valid by week and month. 186 // "Week" is selected for "cycle", and two elements 1 and 3 are filled in point, which means that a conference is held 187 // every Monday and Wednesday, and 0 means Sunday. 188 // "Month" is selected for "cycle", and 12 and 20 are filled in point, which means that a conference will be held on 189 // the 12th and 20th of each month. The value range is [1,31]. If there is no such value in the current month, then 190 // for the end of the month. 191 Points []int `json:"point,omitempty"` 192 // Support the user to specify the number of days N for advance conference notice, the booker will receive the notice 193 // of the whole cycle conference, and all the participants will receive the conference notice (including the calendar) 194 // N days before each sub-conference time. 195 // The input of the number of days N is automatically adjusted according to the interval. 196 // If it is held every 2 days on a daily basis, N will automatically become 2, and if it is a Monday or Tuesday 197 // every 2 weeks on a weekly basis, N will automatically become 14. Constraints: DST handling is not considered for 198 // now. The valid value is range from 0 to 30. The default is 1. 199 PreRemindDays *int `json:"preRemindDays,omitempty"` 200 } 201 202 type Configuration struct { 203 // Whether to send conference email notification. The default value is determined by the enterprise-level configuration. 204 // true: required. 205 // false: not required. 206 IsSendNotify *bool `json:"isSendNotify,omitempty"` 207 // Whether to send conference SMS notification. The default value is determined by the enterprise-level configuration. 208 // true: required. 209 // false: not required. 210 // Only official commercial enterprises have the right to send conference SMS notifications. 211 // Free enterprises will not send conference SMS notifications even if isSendSms is set to true. 212 IsSendSms *bool `json:"isSendSms,omitempty"` 213 // Whether to send conference calendar notifications. The default value is determined by the enterprise-level configuration. 214 // true: required. 215 // false: not required. 216 IsSendCalendar *bool `json:"isSendCalendar,omitempty"` 217 // Whether the soft terminal is automatically muted when the guest joins the conference. 218 // The default value is determined by the enterprise-level configuration. 219 // true: Automatic mute. 220 // false: Do not mute automatically. 221 IsAutoMute *bool `json:"isAutoMute,omitempty"` 222 // Whether the guest joins the conference, whether the hard terminal is automatically muted. 223 // The default value is determined by the enterprise-level configuration. 224 // true: Automatic mute. 225 // false: Do not mute automatically. 226 IsHardTerminalAutoMute *bool `json:"isHardTerminalAutoMute,omitempty"` 227 // Whether the guest is password-free (only valid for random conferences). 228 // true: no password. 229 // false: A password is required. 230 IsGuestFreePwd *bool `json:"isGuestFreePwd,omitempty"` 231 // The range to allow incoming calls. 232 // 0: All users. 233 // 2: Users within the enterprise. 234 // 3: The invited user. 235 CallInRestriction *int `json:"callInRestriction,omitempty"` 236 // Whether to allow guests to start conferences (only valid for random ID conferences). 237 // true: Allows guests to start conferences. 238 // false: Disables guests from starting conferences. 239 AllowGuestStartConf *bool `json:"allowGuestStartConf,omitempty"` 240 // Guest password (pure number 4-16 digits long). 241 GuestPwd string `json:"guestPwd,omitempty"` 242 // Cloud conference room conference ID mode. 243 // 0: Fixed ID. 244 // 1: Random ID. 245 VmrIDType *int `json:"vmrIDType,omitempty"` 246 // Automatically extend the conference duration (recommended value range is 0-60). 247 // 0: Indicates that the conference ends automatically at the end of the session, and does not extend the conference. 248 // Others: Indicates the duration of the automatic extension. 249 // Automatically ending the conference is calculated according to the duration of the conference. For example, a scheduled conference starts at 9:00 and ends at 11:00, and the conference lasts for 2 hours. If a participant joins the conference at 8:00, the conference will automatically end at 10:00. 250 ProlongLength *int `json:"prolongLength,omitempty"` 251 // Whether to open the waiting room (only valid for RTC enterprises). 252 // true: On. 253 // false: not enabled. 254 EnableWaitingRoom *bool `json:"enableWaitingRoom,omitempty"` 255 } 256 257 // Create is a method to initiate a conference using given parameters. 258 func Create(c *golangsdk.ServiceClient, opts CreateOpts) ([]Conference, error) { 259 url := rootURL(c) 260 // Whether the conference is the the cycle conference. 261 if opts.CycleParams != nil { 262 url = cycleURL(c) 263 } 264 265 b, err := golangsdk.BuildRequestBody(opts, "") 266 if err != nil { 267 return nil, err 268 } 269 270 var r []Conference 271 _, err = c.Post(url, b, &r, &golangsdk.RequestOpts{ 272 MoreHeaders: map[string]string{ 273 "Content-Type": "application/json;charset=UTF-8", 274 "X-Access-Token": opts.Token, 275 }, 276 }) 277 return r, err 278 } 279 280 type GetOpts struct { 281 // Conference ID. 282 ConferenceId string `q:"conferenceID"` 283 // Offset from which the query starts. 284 // If the offset is less than 0, the value is automatically converted to 0. Default to 0. 285 Offset int `q:"offset"` 286 // Number of items displayed on each page. The valid values are range form 1 to 500, default to 20. 287 Limit int `q:"limit"` 288 // User ID. 289 UserId string `q:"userUUID"` 290 // Authorization. 291 Token string `json:"-"` 292 } 293 294 // Get is a method to obtain scheduled or online conference details using given parameters. 295 func Get(c *golangsdk.ServiceClient, opts GetOpts) (*GetResp, error) { 296 url := showURL(c) 297 query, err := golangsdk.BuildQueryString(opts) 298 if err != nil { 299 return nil, err 300 } 301 url += query.String() 302 303 var r GetResp 304 _, err = c.Get(url, &r, &golangsdk.RequestOpts{ 305 MoreHeaders: map[string]string{ 306 "Content-Type": "application/json;charset=UTF-8", 307 "X-Access-Token": opts.Token, 308 }, 309 }) 310 return &r, err 311 } 312 313 // GetOnline is a method to obtain online conference using given parameters. 314 func GetOnline(c *golangsdk.ServiceClient, opts GetOpts) (*GetResp, error) { 315 url := onlineURL(c) 316 query, err := golangsdk.BuildQueryString(opts) 317 if err != nil { 318 return nil, err 319 } 320 url += query.String() 321 322 var r GetResp 323 _, err = c.Get(url, &r, &golangsdk.RequestOpts{ 324 MoreHeaders: map[string]string{ 325 "Content-Type": "application/json;charset=UTF-8", 326 "X-Access-Token": opts.Token, 327 }, 328 }) 329 return &r, err 330 } 331 332 type GetHistoryOpts struct { 333 // Conference UUID. 334 ConferenceUuid string `q:"confUUID"` 335 // Offset from which the query starts. 336 // If the offset is less than 0, the value is automatically converted to 0. Default to 0. 337 Offset int `q:"offset"` 338 // Number of items displayed on each page. The valid values are range form 1 to 500, default to 20. 339 Limit int `q:"limit"` 340 // User ID. 341 UserId string `q:"userUUID"` 342 // Authorization token. 343 Token string `json:"-"` 344 } 345 346 // GetHistory is a method to obtain history conference using given parameters. 347 func GetHistory(c *golangsdk.ServiceClient, opts GetHistoryOpts) (*GetResp, error) { 348 url := historyURL(c) 349 query, err := golangsdk.BuildQueryString(opts) 350 if err != nil { 351 return nil, err 352 } 353 url += query.String() 354 355 var r GetResp 356 _, err = c.Get(url, &r, &golangsdk.RequestOpts{ 357 MoreHeaders: map[string]string{ 358 "Content-Type": "application/json;charset=UTF-8", 359 "X-Access-Token": opts.Token, 360 }, 361 }) 362 return &r, err 363 } 364 365 type ListHistoryOpts struct { 366 // User UUID. 367 UserUUID string `q:"userUUID"` 368 // Offset from which the query starts. 369 // If the offset is less than 0, the value is automatically converted to 0. Default to 0. 370 Offset int `q:"offset"` 371 // Number of items displayed on each page. The valid values are range form 1 to 500, default to 20. 372 Limit int `q:"limit"` 373 // Query historical conferences based on the conference subject, the reservation and the string of conference ID 374 // keywords. 375 SearchKey string `q:"searchKey"` 376 // Whether to query the meeting records of all users under the enterprise. 377 // If the login account is not an enterprise administrator, this field is invalid. 378 // If this field is true, the userUUID field has no effect. 379 // The default value is 'false'. 380 QueryAll bool `q:"queryAll"` 381 // The query's starting date in milliseconds. For example: 1583078400000 382 StartDate int `q:"startDate"` 383 // The query deadline in milliseconds. For example: 1585756799000 384 EndDate int `q:"endDate"` 385 //ASC_StartTIME: Sort by meeting start time in ascending order. 386 // DSC_StartTIME: Sort in descending order according to the conference start time. 387 // ASC_RecordTYPE: Sort according to whether there are recording files or not, and then sort according to the 388 // conference start time in ascending order by default. 389 // DSC_RecordTYPE: Sort according to whether there are recording files or not, and then sort by the conference 390 // start time in descending order by default. 391 SortType string `q:"sortType"` 392 // Authorization token. 393 Token string `json:"-"` 394 } 395 396 // ListHistory is a method to obtain history conference list using given parameters. 397 func ListHistory(c *golangsdk.ServiceClient, opts ListHistoryOpts) ([]Conference, error) { 398 url := historiesURL(c) 399 query, err := golangsdk.BuildQueryString(opts) 400 if err != nil { 401 return nil, err 402 } 403 url += query.String() 404 405 var r struct { 406 Conferences []Conference `json:"data"` 407 } 408 _, err = c.Get(url, &r, &golangsdk.RequestOpts{ 409 MoreHeaders: map[string]string{ 410 "Content-Type": "application/json;charset=UTF-8", 411 "X-Access-Token": opts.Token, 412 }, 413 }) 414 return r.Conferences, err 415 } 416 417 type UpdateOpts struct { 418 // Conference ID. 419 ConferenceID string `q:"conferenceID"` 420 // Conference UUID. 421 UserUUID string `q:"userUUID"` 422 // The conference start time (UTC time). 423 // When creating a reservation conference, if the start time is not specified or the blank string is filled in, it 424 // means that the conference will start immediately. 425 // The time is in UTC, which is the time in time zone 0. 426 // Format: yyyy-MM-dd HH:mm 427 StartTime string `json:"startTime,omitempty"` 428 // The duration of the conference, in minutes, with a maximum value of 1440 and a minimum value of 15. 429 // The default is 30. 430 Length int `json:"length,omitempty"` 431 // Conference subject. The length is limited to 128 characters. 432 Subject string `json:"subject,omitempty"` 433 // The media type of the conference. 434 // It consists of one or more enumeration Strings. When there are multiple enumerations, each enumeration value is 435 // separated by "," commas. The enumeration values are as follows: 436 // "Voice": Voice. 437 // "Video": SD video. 438 // "HDVideo": High-definition video (mutually exclusive with Video, if Video and HDVideo are selected at the same 439 // time, the system will select Video by default). 440 // "Telepresence": Telepresence (mutually exclusive with HDVideo and Video, if selected at the same time, the 441 // system uses Telepresence). (reserved field) 442 // "Data": Multimedia (system configuration determines whether to automatically add Data). 443 MediaTypes string `json:"mediaTypes,omitempty"` 444 // When the soft terminal creates an instant conference, it carries a temporary group ID in the current field, which 445 // is carried by the server in the conference-info header field when inviting other participants. 446 // The length is limited to 31 characters. 447 GroupUri string `json:"groupuri,omitempty"` 448 // Attendee list. This list can be used to send conference notifications, conference reminders, and automatic invitations 449 // when the conference starts. 450 Participants []Participant `json:"attendees,omitempty"` 451 // The parameter of the periodic conference. When the conference is a periodic conference, this parameter must be filled in, 452 // otherwise the server ignores this parameter. 453 // This parameter includes the start date, end date of the periodic conference, the period of the conference and the 454 // conference time point in the period. 455 CycleParams *CycleParams `json:"cycleParams,omitempty"` 456 // Whether the conference automatically starts recording, it only takes effect when the recording type is: 457 // 1: Automatically start recording. 458 // 0: Do not start recording automatically. 459 // The default is not to start automatically. 460 IsAutoRecord *int `json:"isAutoRecord,omitempty"` 461 // Conference media encryption mode. 462 // 0: Adaptive encryption. 463 // 1 : Force encryption. 464 // 2 : Do not encrypt. 465 // Default values are populated by enterprise-level configuration. 466 EncryptMode *int `json:"encryptMode,omitempty"` 467 // The default language of the conference, the default value is defined by the conference cloud service. 468 // For languages supported by the system, it is passed according to the RFC3066 specification. 469 // zh-CN: Simplified Chinese. 470 // en-US: US English. 471 Language string `json:"language,omitempty"` 472 // The time zone information of the conference time in the conference notification. 473 // For time zone information, refer to the time zone mapping relationship. 474 // For example: "timeZoneID":"26", the time in the conference notification sent through HUAWEI CLOUD conference will be 475 // marked as "2021/11/11 Thursday 00:00 - 02:00 (GMT) Greenwich Standard When: Dublin, Edinburgh, Lisbon, London". 476 // For an aperiodic conference, if the conference notification is sent through a third-party system, this field does not 477 // need to be filled in. 478 TimeZoneID string `json:"timeZoneID,omitempty"` 479 // Recording type. 480 // 0: Disabled. 481 // 1: Live broadcast. 482 // 2: Record and broadcast. 483 // 3: Live + Recording. 484 // Default is disabled. 485 RecordType *int `json:"recordType,omitempty"` 486 // The mainstream live broadcast address, with a maximum of 255 characters. 487 // It is valid when the recording type is 2 or 3. 488 LiveAddress string `json:"liveAddress,omitempty"` 489 // Auxiliary streaming address, the maximum length is 255 characters. 490 // It is valid when the recording type is 2 or 3. 491 AuxAddress string `json:"auxAddress,omitempty"` 492 // Whether to record auxiliary stream. 493 // 0: Do not record. 494 // 1: Record. 495 // It is valid when the recording type is 2 or 3. 496 RecordAuxStream *int `json:"recordAuxStream,omitempty"` 497 // Other configuration information for the conference. 498 Configuration *Configuration `json:"confConfigInfo,omitempty"` 499 // Recording authentication method. 500 // 0: Viewable/downloadable via link. 501 // 1: Enterprise users can watch/download. 502 // 2: Attendees can watch/download. 503 // It is valid when the recording type is 2 or 3. 504 RecordAuthType *int `json:"recordAuthType,omitempty"` 505 // Whether to use the cloud conference room or personal conference ID to hold a reservation conference. 506 // 0: Do not use cloud conference room. 507 // 1: Use cloud conference room or personal conference ID. 508 // Cloud conference rooms are not used by default. 509 VmrFlag *int `json:"vmrFlag,omitempty"` 510 // VMR ID bound to the current founding account. 511 // Obtained by querying the cloud conference room and personal conference ID interface. 512 // Note: 513 // vmrID takes the ID returned in the above query interface, not vmrId. 514 // When creating a conference with a personal conference ID, use VMR with vmrMode=0; 515 // When creating a conference in a cloud conference room, use VMR with vmrMode=1. 516 VmrId string `json:"vmrID,omitempty"` 517 // The number of parties in the conference, the maximum number of participants in the conference. 518 // 0: Unlimited. 519 // Greater than 0: the maximum number of participants in the conference. 520 ConcurrentParticipants *int `json:"concurrentParticipants,omitempty"` 521 // The authorization token. 522 Token string `json:"-" required:"true"` 523 } 524 525 // Update is a method to udpate the conference configuration using given parameters. 526 func Update(c *golangsdk.ServiceClient, opts UpdateOpts) ([]Conference, error) { 527 url := rootURL(c) 528 // Whether the conference is the the cycle conference. 529 if opts.CycleParams != nil { 530 url = cycleURL(c) 531 } 532 query, err := golangsdk.BuildQueryString(opts) 533 if err != nil { 534 return nil, err 535 } 536 url += query.String() 537 538 b, err := golangsdk.BuildRequestBody(opts, "") 539 if err != nil { 540 return nil, err 541 } 542 543 var r []Conference 544 _, err = c.Put(url, b, &r, &golangsdk.RequestOpts{ 545 MoreHeaders: map[string]string{ 546 "Content-Type": "application/json;charset=UTF-8", 547 "X-Access-Token": opts.Token, 548 }, 549 }) 550 return r, err 551 } 552 553 type DeleteOpts struct { 554 ConferenceId string `q:"conferenceID"` 555 UserId string `q:"userUUID"` 556 Type int `q:"type"` 557 IsCycle bool `json:"-"` 558 Token string `json:"-"` 559 } 560 561 // Delete is a method to cancel conference using given parameters. 562 func Delete(c *golangsdk.ServiceClient, opts DeleteOpts) error { 563 url := rootURL(c) 564 // Whether the conference is the the cycle conference. 565 if opts.IsCycle { 566 url = cycleURL(c) 567 } 568 query, err := golangsdk.BuildQueryString(opts) 569 if err != nil { 570 return err 571 } 572 url += query.String() 573 574 _, err = c.Delete(url, &golangsdk.RequestOpts{ 575 MoreHeaders: map[string]string{ 576 "Content-Type": "application/json;charset=UTF-8", 577 "X-Access-Token": opts.Token, 578 }, 579 }) 580 return err 581 } 582 583 type AuthOpts struct { 584 ConferenceId string `q:"conferenceID"` 585 Password string `json:"-"` 586 } 587 588 // GetControlToken is a method to generate a control token according to the chair password and conference ID. 589 func GetControlToken(c *golangsdk.ServiceClient, opts AuthOpts) (*AuthResp, error) { 590 url := controlURL(c) 591 query, err := golangsdk.BuildQueryString(opts) 592 if err != nil { 593 return nil, err 594 } 595 url += query.String() 596 597 var r AuthResp 598 _, err = c.Get(rootURL(c), &r, &golangsdk.RequestOpts{ 599 MoreHeaders: map[string]string{ 600 "Content-Type": "application/json;charset=UTF-8", 601 "X-Password": opts.Password, 602 "X-Login-Type": "1", 603 }, 604 }) 605 return &r, err 606 } 607 608 type ExtendOpts struct { 609 ConferenceId string `q:"conferenceID"` 610 IsAuto int `json:"auto" required:"true"` 611 Duration int `json:"duration,omitempty"` 612 Token string `json:"-"` 613 } 614 615 // ExtendTime is a method to extend conference time using given parameters. 616 func ExtendTime(c *golangsdk.ServiceClient, opts ExtendOpts) error { 617 url := controlURL(c) 618 query, err := golangsdk.BuildQueryString(opts) 619 if err != nil { 620 return err 621 } 622 url += query.String() 623 624 b, err := golangsdk.BuildRequestBody(opts, "") 625 if err != nil { 626 return err 627 } 628 629 _, err = c.Put(url, b, nil, &golangsdk.RequestOpts{ 630 MoreHeaders: map[string]string{ 631 "Content-Type": "application/json;charset=UTF-8", 632 "X-Conference-Authorization": opts.Token, 633 }, 634 }) 635 return err 636 }