code: func New(ctxProvider context.ClientProvider, opts ...ClientOption) (*Client, error) {
  
  	ctx, err := ctxProvider()
  	if err != nil {
  		return nil, errors.WithMessage(err, "failed to create resmgmt client due to context error")
  	}
  
  	if ctx.Identifier().MSPID == "" {
  		return nil, errors.New("mspID not available in user context")
  	}
  
  	resourceClient := &Client{
  		ctx: ctx,
  	}
  
  	for _, opt := range opts {
  		err1 := opt(resourceClient)
  		if err1 != nil {
  			return nil, err1
  		}
  	}
  
  	if resourceClient.localCtxProvider == nil {
  		resourceClient.localCtxProvider = func() (context.Local, error) {
  			return contextImpl.NewLocal(
  				func() (context.Client, error) {
  					return resourceClient.ctx, nil
  				},
  			)
  		}
  	}
  
  	return resourceClient, nil
  }
docs: // New returns a resource management client instance.