insertSocketPlug static method

Insert a plug into a socketed item. I know how it sounds, but I assure you it's much more G-rated than you might be guessing. We haven't decided yet whether this will be able to insert plugs that have side effects, but if we do it will require special scope permission for an application attempting to do so. You must have a valid Destiny Account, and either be in a social space, in orbit, or offline. Request must include proof of permission for 'InsertPlugs' from the account owner.

Implementation

static Future<DestinyItemChangeResponseResponse> insertSocketPlug (
    HttpClient client,
    DestinyInsertPlugsActionRequest body
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final HttpClientConfig config = HttpClientConfig('POST', '/Destiny2/Actions/Items/InsertSocketPlug/', params);
    config.body = await body.asyncToJson();
    config.bodyContentType = 'application/json';
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return DestinyItemChangeResponseResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}