Example #1
0
        /// <inheritdoc />
        protected override void ProcessRecord()
        {
            if (!this.ValidateHasExactlyOneValue(Identity, queryType: nameof(Identity)))
            {
                return;
            }

            var request = new AccessoryCheckInRequest(Identity.Value[0]);

            if (!string.IsNullOrEmpty(Note))
            {
                request.Note = Note;
            }
            WriteObject(ApiHelper.Instance.Accessories.CheckIn(request));
        }
Example #2
0
 /// <summary>
 /// Check in an accessory.
 /// </summary>
 /// <param name="request">An accessory check-in request.</param>
 /// <returns></returns>
 public RequestResponse <ApiObject> CheckIn(AccessoryCheckInRequest request)
 => Api.RequestManager.Post <AccessoryCheckInRequest, ApiObject>($"{EndPointInfo.BaseUri}/{request.Accessory.Id}/checkin", request).RethrowExceptionIfAny().Value;